Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

386
Vistas
Error was: No module named postgresql.base ImproperlyConfigured 'django.db.backends.postgresql'

I've installed the postgresql for my django project. Earlier when i installed it and run makemigrations,it worked fine, but due to some reasons i had to uninstall postgresql and removed its files and re-installed the postgresql,when i run it now, it was showing me this insane error.

Settings File:

# Database
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': '*****',
        'USER': '*****',
        'PASSWORD': '',

Error:

File "/Users/Devadanam/Desktop/trackingsys/lib/python2.7/site-packages/django/db/__init__.py", line 33, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "/Users/Devadanam/Desktop/trackingsys/lib/python2.7/site-packages/django/db/utils.py", line 211, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "/Users/Devadanam/Desktop/trackingsys/lib/python2.7/site-packages/django/db/utils.py", line 134, in load_backend
    raise ImproperlyConfigured(error_msg)
django.core.exceptions.ImproperlyConfigured: 'django.db.backends.postgresql' isn't an available database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
    'mysql', 'oracle', 'sqlite3'
Error was: No module named postgresql.base
over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

It looks like you haven't installed psycopg2

pip install psycopg2

Another possible reason is

Changed in Django 1.9:

The django.db.backends.postgresql backend is named django.db.backends.postgresql_psycopg2 in older releases. For backwards compatibility, the old name still works in newer versions.

https://docs.djangoproject.com/en/1.9/ref/settings/#std:setting-DATABASE-ENGINE

So you should change to use django.db.backends.postgresql

over 4 years ago · Santiago Trujillo Denunciar

0

The problem is i have deleted the postgresql files in the my virtulenv's lib/python/../django/db.. I created a new virtualenv and all postgres files were back. Excuse me for that!

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda