-
-
Notifications
You must be signed in to change notification settings - Fork 252
I can't run "python manage.py migrate", please give solution #29
Comments
Seems to be a problem with the setup of the Postgres DDBB. Could you explain further? Did you create an .env and change the values? |
@sahal-git make sure you installed PostgreSQL and it's running |
@sahal-git You're not engaging with this conversation, so I assume the problem is fixed and I will close this issue. |
sir same problemi have pgadmin4 created data base named django_lms_data but it still PS C:\Users\LENOVO Z40\django-lms> python manage.py makemigrations |
@sahal-git hey I'm facing the same issue, how did you solve it? |
It looks like you haven't defined an env variable called
|
PS C:\Users\ARSHAD\Documents\GitHub\django-lms> python manage.py migrate
Traceback (most recent call last):
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\db\backends\base\base.py", line 244, in ensure_connection
self.connect()
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\utils\asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\db\backends\base\base.py", line 225, in connect
self.connection = self.get_new_connection(conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\utils\asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\db\backends\postgresql\base.py", line 203, in get_new_connection
connection = Database.connect(**conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\psycopg2_init_.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: FATAL: role "[DB_ADMIN_NAME]" does not exist
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\manage.py", line 21, in
main()
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\core\management_init_.py", line 446, in execute_from_command_line
utility.execute()
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\core\management_init_.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\core\management\base.py", line 414, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\core\management\base.py", line 460, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\core\management\base.py", line 98, in wrapped
res = handle_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\core\management\commands\migrate.py", line 91, in handle
self.check(databases=[database])
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\core\management\base.py", line 487, in check
all_issues = checks.run_checks(
^^^^^^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\core\checks\registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\core\checks\model_checks.py", line 36, in check_all_models
errors.extend(model.check(**kwargs))
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\db\models\base.py", line 1461, in check
*cls._check_indexes(databases),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\db\models\base.py", line 1864, in _check_indexes
connection.features.supports_covering_indexes
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\utils\functional.py", line 49, in get
res = instance.dict[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\db\backends\postgresql\features.py", line 84, in is_postgresql_11
return self.connection.pg_version >= 110000
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\utils\functional.py", line 49, in get
res = instance.dict[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\db\backends\postgresql\base.py", line 354, in pg_version
with self.temporary_connection():
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2288.0_x64__qbz5n2kfra8p0\Lib\contextlib.py", line 137, in enter
return next(self.gen)
^^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\db\backends\base\base.py", line 639, in temporary_connection
with self.cursor() as cursor:
^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\utils\asyncio.py", line 26, in inner
return func(*args, kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\db\backends\base\base.py", line 284, in cursor
return self._cursor()
^^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\db\backends\base\base.py", line 260, in cursor
self.ensure_connection()
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\utils\asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\db\backends\base\base.py", line 243, in ensure_connection
with self.wrap_database_errors:
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\db\utils.py", line 91, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\db\backends\base\base.py", line 244, in ensure_connection
self.connect()
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\utils\asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\db\backends\base\base.py", line 225, in connect
self.connection = self.get_new_connection(conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\utils\asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\django\db\backends\postgresql\base.py", line 203, in get_new_connection
connection = Database.connect(**conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARSHAD\Documents\GitHub\django-lms\venv\Lib\site-packages\psycopg2_init.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, kwasync)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
django.db.utils.OperationalError: connection to server at "localhost" (::1), port 5432 failed: FATAL: role "[DB_ADMIN_NAME]" does not exist
### Source code:
CODE_OF_CONDUCT.md
CONTRIBUTING.md
README.md
requirements.txt
TODO.md
The text was updated successfully, but these errors were encountered: