Database "postgres" does not exist error when running test command

825 views
Skip to first unread message

Daniel Grace

unread,
Nov 14, 2014, 12:10:41 PM11/14/14
to django...@googlegroups.com
Hi,
I get an error when running the test command:
>python manage.py test flow

Creating test database for alias 'default'...
Traceback (most recent call last):
  File "C:\landy\lib\site-packages\django\db\backends\__init__.py", line 133, in
 ensure_connection
    self.connect()
  File "C:\landy\lib\site-packages\django\db\backends\__init__.py", line 122, in
 connect
    self.connection = self.get_new_connection(conn_params)
  File "C:\landy\lib\site-packages\django\db\backends\postgresql_psycopg2\base.p
y", line 134, in get_new_connection
    return Database.connect(**conn_params)
  File "C:\landy\lib\site-packages\psycopg2\__init__.py", line 164, in connect
    conn = _connect(dsn, connection_factory=connection_factory, async=async)
psycopg2.OperationalError: FATAL:  database "postgres" does not exist

Here is the database settings:
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'cresta',                      
        'USER': 'postgres',
        'PASSWORD': 'test1234',
        'HOST': '',
        'ATOMIC_REQUESTS': True
    }
}

I don't get any errors when manually testing.  What is going on?

Thanks

Aliane Abdelouahab

unread,
Nov 14, 2014, 7:58:32 PM11/14/14
to django...@googlegroups.com

Daniel Grace

unread,
Nov 15, 2014, 9:02:01 AM11/15/14
to django...@googlegroups.com
On Saturday, 15 November 2014 00:58:32 UTC, Aliane Abdelouahab wrote:

That link, what is that about?

Anyway, I manually created a database called "postgres" and the error went away.

Thomas G Lockhart

unread,
Nov 15, 2014, 9:47:55 AM11/15/14
to django...@googlegroups.com
That link suggested doing exactly what you did!

- Tom

Reply all
Reply to author
Forward
0 new messages