I would like to use the PostGreSQL
database with Django.
I first installed the driver psycopg2
with pip
and virtualenv
:
$ PATH=$PATH:/Library/PostgreSQL/9.3/bin/
$ pip install psycopg2
[...]
Successfully installed psycopg2
Cleaning up...
$
I have done the following configuration in Django:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'my_db',
'USER': 'django',
'PASSWORD': 'xx',
'HOST': 'localhost',
'PORT': '5432',
}
}
But when I try to create the schema with syncdb
I have the following error:
$ python manage.py syncdb
raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: dlopen([...]/Code/env/dev/lib/python2.7/site-packages/psycopg2/_psycopg.so, 2): Library not loaded: libssl.1.0.0.dylib
Referenced from: [...]Code/env/dev/lib/python2.7/site-packages/psycopg2/_psycopg.so
Reason: image not found
Do you know why the libssl
is not loaded and how can I fix this issue?
Thank you