Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

724
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!