skip to Main Content

When I change sqlite3 to postgresql, I receave error,
this error I have only then I run apache2,
if I start "manage.py runserver 0.0.0.0:8000" its work fine.
I tried so many things, but I couldn’t find the answer.

psycopg2 is installed.

Part of error:

file "/../...postgresql/base.py", line 25..
  import psycopg as Database 
ModuleNotFoundError: No module namged 'psycopg'

file "/../...postgresql/base.py", line 27..
  import psycopg2 as Database 
ModuleNotFoundError: No module namged 'psycopg2'
..
..
Traceback (..):
 file /../../wsgi.py
   application =get_wsgi_application()
..
..
..
..

mod_wsgi (pid-1111): Target SWGI script '/aa/bb/wsgi.py' does not contain WSGI application 'application'

remove libraries and renew install, restart apache2, correct wsgi.py, 000-default.conf

2

Answers


  1. Chosen as BEST ANSWER

    I solved my problems, when I created new environment in my project, everything is ok. Maybe, I had mistake in old environment when I tried install any libraries.


  2. For the first part you can try installing psycopg2-binary using this command:

    pip install psycopg2-binary
    

    for the second part, it seems there is an issue with your wsgi.py file, may you provide more logs?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search