After you've installed Django and deployed the project, configure the setting.py file,
To modify database data:
Save the configuration, return to the project root, run the Python manage.py shell, and execute the following command:
>>> from django.db import connection
>>> cursor = Connection.cursor ()
When this method is validated, an error
File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line +, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1471, in Exec_module
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "/opt/python3.4.1/lib/python3.4/site-packages/django-1.7.1-py3.4.egg/django/db/backends/postgresql_ psycopg2/base.py ", line +, in <module>
Raise Improperlyconfigured ("Error loading PSYCOPG2 module:%s"% e)
Django.core.exceptions.ImproperlyConfigured:Error loading PSYCOPG2 module:libpq.so.5:cannot Open Shared Object file:n o Such file or directory
To use the workaround:
To download the Libpq.so.5 installation package:
wget ftp://ftp.muug.mb.ca/mirror/centos/5.11/os/x86_64/CentOS/postgresql84-libs-8.4.20-1.el5_10.i386.rpm
Then install:
RPM-IVH postgresql84-libs-8.4.20-1.el5_10.i386.rpm
The problem is resolved because the database version is 91, but the patch is supported for 84 of the database version and may have compatibility issues.
Problem logging when pgsql9.1 database connectivity for Django and database on Contos