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👍
It’s because unlike SQLite, you need to create the database, you can follow this guide https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-django-with-postgres-nginx-and-gunicorn#step-seven-configure-postgresql
- [Django]-MySQLdb install error – _mysql.c:44:23: error: my_config.h: No such file or directory
- [Django]-Interactive Graphviz graphs in a web application
- [Django]-Add inline model to django admin site
2👍
Here ‘NAME’ means user name which is by default ‘postgres’ . So ‘NAME’ should be username not database name . Try this it’s works
- [Django]-Unique foreign key pairs with Django
- [Django]-How to show a many-to-many field with "list_display" in Django Admin?
- [Django]-Django Template Ternary Operator
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.
- [Django]-Django check for any exists for a query
- [Django]-Override default get_absolute_url on User objects?
- [Django]-How to show a message to a django admin after saving a model?