Reputation: 573
I am creating a Django project based on PostGreSql on Windows OS.
I could successfully download Postgresql (32bits) and psycopg2. I work on a 32 bit Python2.7.9 , and my Postgresql - 9.3.7 32-bits.
My settings.py contains the following:
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'testdb' , 'USER': 'postgres', 'PASSWORD': 'paggu', 'HOST': 'localhost', 'PORT': '5432', } }
But I still get the below error when I try to execute the command- python manage.py runserver or python manage.py syncdb
raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: DLL
load failed: The specified module could not be found.
I am not sure if I missed on anything.
I looked up on the other Stack Overflow posts regarding this problem but didn't seem to find any solution.
Upvotes: 4
Views: 1495
Reputation: 929
You may need to actually install psycopg2. To find out run the following in a Windows command prompt:
C:\path\to\project\> python
Then:
>>> help("modules")
If psycopg2 is not in the list, do the following:
Download: psycopg2-2.6.2.win32-py2.7-pg9.5.3-release.exe from HERE, then run the following in a Windows command prompt:
C:\path\to\project> easy_install /path/to/psycopg2-2.6.2.win32-py2.7-pg9.5.3-release.exe
Upvotes: 1