I deployed my django application with sqlite3, uwsgi emperor mode and python v3.6.7 on ubuntu 18.04
Now I changed database to postgresql, every thing worked fine in my local machine, but in the server when I run uwsgi server.ini (for testing purpose) I get this error:
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2'
and application just shows "Internal Server Error" in the browser.
- I can import
psycopg2in the python shell without any error psycopg2is installed in my virtualenv- I installed
python-psycopg2using apt-get too - django will run without any problem using
python manage.py runserver - I did not use
sudowithpipto installpsycopg2 - django
settings.pyconfigs are right, because I performed migrations
I read all similar problems and tried their answers, nothing worked :(
virutalenv wrapperand I open python shell while virtualenv is enabled @Sayse