A. Atiyah
A. Atiyah

Reputation: 555

Try using 'django.db.backends.XXX', where XXX is one of:

I was setting Django up to use PostgresQL and for some reason, it won't connect it keep giving me this error:

Try using 'django.db.backends.XXX', where XXX is one of: 'mysql', 'oracle', 'sqlite3'

here's the code for it in setting.py:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'DBNAME',
        'USER': 'postgres',
        'PASSWORD': 'DBPW',
        'HOST': 'localhost'
    }
}

I had the exact same code in a different project and it works perfectly fine!

Upvotes: 0

Views: 6713

Answers (2)

Khashayar Ghamati
Khashayar Ghamati

Reputation: 368

use this config instead of your config:

DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.postgresql_psycopg2',
    'NAME': 'DBNAME',
    'USER': 'postgres',
    'PASSWORD': 'DBPW',
    'HOST': 'localhost',
    'PORT': '',
 }
}

your ENGINE is not correct.

Upvotes: 0

pragman
pragman

Reputation: 1644

you need to pip install psycopg2, looks like the Postgres adaptor is not installed

Upvotes: 1

Related Questions