R
R
Ruslan2019-10-28 12:36:45
PostgreSQL
Ruslan, 2019-10-28 12:36:45

Why can't I attach the database to the application?

myproject/settings.py

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'test',
        'USER': 'user',
        'PASSWORD': 'pass',
        'HOST': '127.0.0.1',
        'PORT': 5432,
    }
}

an error occurs during migration, writes that the database does not exist:
django.db.utils.OperationalError: FATAL: database "django_test" does not exist
The database has been created, the owner has been created, what should I do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Astrohas, 2019-10-28
@Ruslan1999w

the user must be able to create databases.
ALTER USER user CREATEDB;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question