1

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 psycopg2 in the python shell without any error
  • psycopg2 is installed in my virtualenv
  • I installed python-psycopg2 using apt-get too
  • django will run without any problem using python manage.py runserver
  • I did not use sudo with pip to install psycopg2
  • django settings.py configs are right, because I performed migrations

I read all similar problems and tried their answers, nothing worked :(

Mmd M
  • 45
  • 1
  • 9

0 Answers0