[Django]-Operational Error: FATAL: database "django" does not exist

36👍

PostgreSQL does not auto-create databases on first connection. You must create a database before you can use it.

Connect to PostgreSQL (usually to the administration database, named ‘postgres’), via PgAdmin-III or the command-line psql client, and create the database django. From PgAdmin-III you can do this via the menus; from psql you use the CREATE DATABASE SQL command.

See also Creating a PostgreSQL database in the manual and this tutorial I found in a 5second google search that doesn’t look totally wrong.

What I’d do is connect using psql (you can find it in the Start menu) as the ‘postgres’ user, with the password you set at install time, then:

CREATE USER django WITH PASSWORD 'somepassword';

CREATE DATABASE django WITH OWNER django ENCODING 'utf-8';

6👍

2👍

Here ‘NAME’ means user name which is by default ‘postgres’ . So ‘NAME’ should be username not database name . Try this it’s works

👤Gopal

1👍

All you need to do is to create the database with name django in your postgresql.
By default the user postgres will have privilege on database django and password will the password for user postgres.

Leave a comment