S
S
Sergey Lazarevic2022-02-06 23:32:21
PostgreSQL
Sergey Lazarevic, 2022-02-06 23:32:21

Django OperationalError - Can't connect to database?

Hello! Can you tell me why when setting up a postgresql database on a production server, after specifying the correct data in DATABASES (settings.py), when trying to migrate, an error about incorrect data still pops up?

Password authentication failed for user TEST

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'myproject',
        'USER': 'myprojectuser',
        'PASSWORD': 'password',
        'HOST': '127.0.0.1',
        'PORT': ''5432,
    }
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Lazarevic, 2022-02-07
@fafnir_dragon

The answer turned out to be banal - you need to write the database name and username in the configuration in lowercase. Kick)

D
Dr. Bacon, 2022-02-07
@bacon

Password authentication failed for user TEST
explicitly indicates that the TEST user with such a password and by such a host cannot connect to the database, check this data and the settings of postgres itself

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question