Hi everyone I am new in django and postgresql. Actually I am getting following error when i run the project, Although I am putting right password and username. Please Help me....

219 views
Skip to first unread message

shailendra singh

unread,
Jan 3, 2020, 4:27:27 AM1/3/20
to Django users
The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/Applications/Projects/venv/lib/python3.8/site-packages/django/utils/autoreload.py", line 53, in wrapper
    fn(*args, **kwargs)
  File "/Applications/Projects/venv/lib/python3.8/site-packages/django/core/management/commands/runserver.py", line 120, in inner_run
    self.check_migrations()
  File "/Applications/Projects/venv/lib/python3.8/site-packages/django/core/management/base.py", line 458, in check_migrations
    executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
  File "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/migrations/executor.py", line 18, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/migrations/loader.py", line 49, in __init__
    self.build_graph()
  File "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/migrations/loader.py", line 212, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/migrations/recorder.py", line 76, in applied_migrations
    if self.has_table():
  File "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/migrations/recorder.py", line 56, in has_table
    return self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor())
  File "/Applications/Projects/venv/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/backends/base/base.py", line 260, in cursor
    return self._cursor()
  File "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/backends/base/base.py", line 236, in _cursor
    self.ensure_connection()
  File "/Applications/Projects/venv/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/backends/base/base.py", line 220, in ensure_connection
    self.connect()
  File "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/backends/base/base.py", line 220, in ensure_connection
    self.connect()
  File "/Applications/Projects/venv/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/backends/base/base.py", line 197, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/Applications/Projects/venv/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/backends/postgresql/base.py", line 185, in get_new_connection
    connection = Database.connect(**conn_params)
  File "/Applications/Projects/venv/lib/python3.8/site-packages/psycopg2/__init__.py", line 126, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: FATAL:  password authentication failed for user "postgres"

ramadhan ngallen

unread,
Jan 3, 2020, 5:47:13 AM1/3/20
to Django users
Hello
The reason was due to wrong password for the postgre. Kindly test the password via Pgadmin.

Best Regards

Ramadhan Ngallen
Software Consultant

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fdcdb68e-ce8d-4326-a519-7ae07a51ee2f%40googlegroups.com.

Motaz Hejaze

unread,
Jan 3, 2020, 6:19:17 AM1/3/20
to django...@googlegroups.com
To test just create another user and database and grant all privileges for the new user to the new database and finally add those new credentials to django settings.py

shailendra singh

unread,
Jan 3, 2020, 6:23:11 AM1/3/20
to Django users
Thanks Everyone . Now its done.

sagar ninave

unread,
Jan 3, 2020, 6:27:52 AM1/3/20
to django...@googlegroups.com

Hello Shailendra

I have tried to attached postgresql to django but it could not happened please can you tell me what is procedure to do that

Rajesh Maruti

unread,
Jan 3, 2020, 8:45:17 AM1/3/20
to django...@googlegroups.com
 The authentication error for the database username with password 
 Please check the DB username and password

Muhammed Rafi A

unread,
Jan 3, 2020, 8:45:25 AM1/3/20
to django...@googlegroups.com
password is not correct, check them or reset the password ones more

Reply all
Reply to author
Forward
0 new messages