1

I'm running Django in VPS using Apache2 and wsgi but I am getting a 'no module named: Django' error when I access the domain, what could be wrong? here's my default.conf in apache2,

<VirtualHost *:80>
. . .

Alias /static /home/sammy/myproject/static
<Directory /home/sammy/myproject/static>
    Require all granted
</Directory>

<Directory /home/sammy/myproject/myproject>
    <Files wsgi.py>
        Require all granted
    </Files>
</Directory>

WSGIDaemonProcess myproject python-home=/home/sammy/myproject/myprojectenv python-path=/home/sammy/myproject
WSGIProcessGroup myproject
WSGIScriptAlias / /home/sammy/myproject/myproject/wsgi.py

Graham Dumpleton
  • 57,726
  • 6
  • 119
  • 134
weather api
  • 738
  • 2
  • 8
  • 17
  • 1
    Are you sure you have installed all packages, possibly in requirements.txt file? Also, if you are using a virtualenv, make sure you have site.addsitedir calls in your wsgi.py as shown at https://modwsgi.readthedocs.io/en/develop/user-guides/virtual-environments.html#daemon-mode-multiple-applications – hurturk Feb 18 '17 at 06:31
  • The usual reason is that your Python virtual environment is for a different version of Python than your mod_wsgi is compiled for. They must be the same. You can't force mod_wsgi to run as a different Python version than it was compiled for. – Graham Dumpleton Feb 18 '17 at 08:50

0 Answers0