ImportError: No module named django.core.handlers.wsgi in install django mod_wsgi config on apache

前端 未结 10 965
我寻月下人不归
我寻月下人不归 2021-02-06 22:34

I tried to install django to work with apache and mod_wsgi but get this error:

ImportError: No module named django.core.handlers.wsgi,

I\'v rea

10条回答
  •  醉酒成梦
    2021-02-06 23:33

    Hello!

    If you use deb-distributive of Linux (Debian, Ubuntu, etc), edit the file

    /etc/apache2/modules/wsgi.load
    

    This file contained path to correct wsgi-library (for active version Python interpreter). If you use Python2.6, change string

    LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so-2.7
    

    to

    LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so-2.6
    

    Also, you can change soft link to mod_wsgi module:

    cd /usr/lib/apache2/modules
    ln -s mod_wsgi.so-2.6 mod_wsgi.so
    

    Not forget change link to file in /etc/apache2/modules/wsgi.load and restart apache server

    service apache2 restart
    

    P.S. Sorry for my bad English

提交回复
热议问题