Open snehal0904 opened 2 years ago
hey @snehal0904 use python3 instead of python.
Hi @ChakshuGautam tried this, looks some progress but now getting the below error.
root@shiksha:~/Doc-Generator# docker-compose run web python3 manage.py createsuperuser
WARNING: Found orphan containers (doc-generator_db_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Creating doc-generator_web_run ... done
Exception ignored in: 'FieldInitializationWarning'
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: the static field 'transparent' of type 'aspose.pydrawing.Brushes' is not initialized
Exception ignored in: 'FieldInitializationWarning'
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: the static field 'alice_blue' of type 'aspose.pydrawing.Brushes' is not initialized
Exception ignored in: 'FieldInitializationWarning'
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: the static field 'antique_white' of type 'aspose.pydrawing.Brushes' is not initialized
You have 47 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, db, django_celery_beat, django_celery_results, pdf, sessions.
Run 'python manage.py migrate' to apply them.
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.UndefinedTable: relation "auth_user" does not exist
LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "auth_user...
^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 22, in <module>
main()
File "manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.8/dist-packages/django/contrib/auth/management/commands/createsuperuser.py", line 79, in execute
return super().execute(*args, **options)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.8/dist-packages/django/contrib/auth/management/commands/createsuperuser.py", line 100, in handle
default_username = get_default_username(database=database)
File "/usr/local/lib/python3.8/dist-packages/django/contrib/auth/management/__init__.py", line 141, in get_default_username
auth_app.User._default_manager.db_manager(database).get(
File "/usr/local/lib/python3.8/dist-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 431, in get
num = len(clone)
File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 262, in __len__
self._fetch_all()
File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 1324, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 51, in __iter__
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
File "/usr/local/lib/python3.8/dist-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 98, in execute
return super().execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 66, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/utils.py", line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "auth_user" does not exist
LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "auth_user...
^
ERROR: 1
`
hey @snehal0904, this error is because django migrations are not running in the beginning. Please take the new pull from the branch, I have added steps for migrations in the gitpod script. you can check here
On the below step -
docker-compose run web python manage.py createsuperuser
I am getting the error as -'/usr/src/app/entrypoint.sh' This path is not exist, can someone check.
@ChakshuGautam @radhay-samagra @coolbung