Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

726
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda