python - Postgres FATAL database does not exist Django -


i have seen many of these questions asked ruby not django. have postgres db , created table name adam our postgres user. when psql -l table shows up. however, when trying run migrate error.

fatal:  database "/var/lib/pgsql/9.3/data/adam" not exist 

the psql -l shows this:

name       |  owner   | encoding |   collate   |    ctype    |   access privileges -----------------+----------+----------+-------------+-------------+-----------------------  adam      | postgres     | utf8     | en_us.utf-8 | en_us.utf-8 | 

django settings.py looks like..

databases = {     'default': {         'engine': 'django.db.backends.postgresql_psycopg2',         'name': os.path.join('/var/lib/pgsql/9.3/data/', 'adam'),         'user': 'postgres',         'password': 'correctlytypepassword'     } } 

any ideas why thinks doesn't exist?

your database settings wrong. key "name" should refer database name not path. try this:

databases = { 'default': {     'engine': 'django.db.backends.postgresql_psycopg2',     'name': 'adam',     'user': 'postgres',     'password': 'correctlytypepassword'     } } 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -