When using Django to connect to a postgresql database, use python manager.py migrate
to create a database.
django. Core. Exceptions. ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2' code> solution:
apt install psycopg2
if it fails, don't care if apt install libpq-dev
or apt install postgresql-server-dev-x.y
must be installed successfully, one of them PIP install psycopg2
must be installed successfully. Finally, remember to set an access password for the database set in your setting. Py
, otherwise an error will be reported. You can set the access password by referring to the relevant commands here.