title: mod_wsgi: Exception occurred processing WSGI script (django deployment)
body: <p>I'm trying to deploy a django project with the following Apache configuration:</p>
  
  <p><strong>Apache virtualhost configuration</strong></p>
  
  <pre><code>&lt;Virtualhost *:80&gt;
      DocumentRoot /var/www/project/backend
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined
  
      WSGIDaemonProcess backend python-home=/var/www/project/myenv python-path=/var/www/gestor_documental/backend
  
      WSGIProcessGroup backend
      WSGIScriptAlias / /var/www/project/backend/backend/wsgi.py process-group=backend
      Alias /static/ /var/www/project/backend/static/
  
      &lt;Directory /var/www/project/backend&gt;
              Require all granted
      &lt;/Directory&gt;
  &lt;/Virtualhost&gt;
  </code></pre>
  
  <p><strong>wsgi.load file</strong></p>
  
  <pre><code>LoadModule wsgi_module "/var/www/project/myenv/lib/python3.5/site-packages/mod_wsgi/server/mod_wsgi-py35.cpython-35m-x86_64-linux-gnu.so"
  WSGIPythonHome "/var/www/project/myenv"
  </code></pre>
  
  <p>The wsgi.py is the one django brings by default</p>
  
  <p><strong>wsgi.py</strong></p>
  
  <pre><code>import os
  from django.core.wsgi import get_wsgi_application
  
  os.environ.setdefault("DJANGO_SETTINGS_MODULE", "backend.settings")
  
  application = get_wsgi_application()
  </code></pre>
  
  <p><strong>This is the project tree:</strong></p>
  
  <pre><code>project
  |- backend
  |  |- api (django app)
  |  |- backend
  |     |- ...
  |     |- settings.py
  |     |- wsgi.py
  |-- myenv (virtualenv)
  </code></pre>
  
  <p><strong>And this is the error log I keep getting when i try to load the web:</strong></p>
  
  <pre><code>mod_wsgi (pid=38953): Failed to exec Python script file '/var/www/project/backend/backend/wsgi.py'.
  mod_wsgi (pid=38953): Exception occurred processing WSGI script '/var/www/project/backend/backend/wsgi.py'.
  Traceback (most recent call last):
   File "/var/www/project/backend/backend/wsgi.py", line 16, in &lt;module&gt;
    application = get_wsgi_application()
   File "/var/www/project/myenv/lib/python3.5/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
    django.setup(set_prefix=False)
   File "/var/www/project/myenv/lib/python3.5/site-packages/django/__init__.py", line 22, in setup
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
   File "/var/www/project/myenv/lib/python3.5/site-packages/django/conf/__init__.py", line 53, in __getattr__
    self._setup(name)
   File "/var/www/project/myenv/lib/python3.5/site-packages/django/conf/__init__.py", line 41, in _setup
    self._wrapped = Settings(settings_module)
   File "/var/www/project/myenv/lib/python3.5/site-packages/django/conf/__init__.py", line 97, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
   File "/var/www/project/myenv/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
   File "&lt;frozen importlib._bootstrap&gt;", line 986, in _gcd_import
   File "&lt;frozen importlib._bootstrap&gt;", line 969, in _find_and_load
   File "&lt;frozen importlib._bootstrap&gt;", line 944, in _find_and_load_unlocked
   File "&lt;frozen importlib._bootstrap&gt;", line 222, in _call_with_frames_removed
   File "&lt;frozen importlib._bootstrap&gt;", line 986, in _gcd_import
   File "&lt;frozen importlib._bootstrap&gt;", line 969, in _find_and_load
   File "&lt;frozen importlib._bootstrap&gt;", line 956, in _find_and_load_unlocked
  ImportError: No module named 'backend'
  </code></pre>
  
  <p>I've followed every single tutorial and try tons of configurations but still getting the same error.</p>
  
  <p>I'm using <strong>python 3.5.2</strong> in a virtualenv and <strong>Apache 2.4.18</strong></p>
  
  <p>I've installed mod_wsgi via pip3.</p>
  
  <p>Could someone help me with this and tell me what am i doing wrong?</p>
  
  <p>Thank you.</p>