I want to use postgresql with django so did the following:
sudo apt-get install libpq-dev python-dev
sudo apt-get update
workon myenv
sudo pip install psycopg2
And after configuring my settings.py
correctly, I run
./manage.py syncdb
But an exception gets thrown:
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named psycopg2
The database configuration:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'mydb',
'USER': 'postgres',
'PASSWORD': 'password1234',
'HOST': 'localhost',
'PORT': '',
}
}