469,086 Members | 1,169 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,086 developers. It's quick & easy.

Postgres connectivity with Django

Hi,

I'm stuck with setting up PostgreSQL with Django
Every time I run Django server it shows :

Expand|Select|Wrap|Line Numbers
  1. File "C:\Python38\lib\site-packages\psycopg2\init.py", line 127, in connect
  2.     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
  3. django.db.utils.OperationalError: FATAL:  password authentication failed for user "Test"
Here the user "Test" is my OS username and I'm running the database with default postgres user and a "password" which I've already defined in my Django "settings.py"

Expand|Select|Wrap|Line Numbers
  1. DATABASES = {
  2.     'default': {
  3.         'ENGINE': 'django.db.backends.postgresql',
  4.         'NAME': 'postgres',
  5.         'USERNAME': 'postgres',
  6.         'PASSWORD': 'root',
  7.         'HOST': 'localhost',
  8.         'PORT': '5431',
  9.     }
  10. }
I tried using the :

Expand|Select|Wrap|Line Numbers
  1. ALTER USER user_name WITH PASSWORD "password";
But still the error persists.

I even tried editing the "pg_hba.conf" file and manually added "trust" method for all users on my "localhost" but no help.

I'm running Postgres12 on Windows 10

Can you please guide me through this in what I might be doing wrong?

Thanks!
Mar 18 '20 #1
0 2141

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

28 posts views Thread by flamesrock | last post: by
13 posts views Thread by Ilias Lazaridis | last post: by
1 post views Thread by kernel1983 | last post: by
4 posts views Thread by seb.haase | last post: by
4 posts views Thread by K | last post: by
reply views Thread by imhomer | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.