Target WSGI Script Cannot Be Loaded as Python Module in Django App
<p>From my Apache error log.</p>

<pre><code>[Tue Jan 26 00:37:50.840680 2016] [:error] [pid 6522] [client 70.70.241.146:57247] mod_wsgi (pid=6522): Target WSGI script '/var/www/site/public_html/project/apache/wsgi.py' cannot be loaded as Python module.
[Tue Jan 26 00:37:50.840791 2016] [:error] [pid 6522] [client 70.70.241.146:57247] mod_wsgi (pid=6522): Exception occurred processing WSGI script '/var/www/site/public_html/project/apache/wsgi.py'.
[Tue Jan 26 00:37:50.840852 2016] [:error] [pid 6522] [client 70.70.241.146:57247] Traceback (most recent call last):
[Tue Jan 26 00:37:50.841081 2016] [:error] [pid 6522] [client 70.70.241.146:57247]   File "/var/www/site/public_html/project/apache/wsgi.py", line 23, in &lt;module&gt;
[Tue Jan 26 00:37:50.841094 2016] [:error] [pid 6522] [client 70.70.241.146:57247]     application = get_wsgi_application()
[Tue Jan 26 00:37:50.841252 2016] [:error] [pid 6522] [client 70.70.241.146:57247]   File "/opt/env/lib/python3.4/site-packages/django/core/wsgi.py", line 14, in get_wsgi_application
[Tue Jan 26 00:37:50.841264 2016] [:error] [pid 6522] [client 70.70.241.146:57247]     django.setup()
[Tue Jan 26 00:37:50.841400 2016] [:error] [pid 6522] [client 70.70.241.146:57247]   File "/opt/env/lib/python3.4/site-packages/django/__init__.py", line 17, in setup
[Tue Jan 26 00:37:50.841412 2016] [:error] [pid 6522] [client 70.70.241.146:57247]     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
[Tue Jan 26 00:37:50.841619 2016] [:error] [pid 6522] [client 70.70.241.146:57247]   File "/opt/env/lib/python3.4/site-packages/django/conf/__init__.py", line 48, in __getattr__
[Tue Jan 26 00:37:50.841632 2016] [:error] [pid 6522] [client 70.70.241.146:57247]     self._setup(name)
[Tue Jan 26 00:37:50.841672 2016] [:error] [pid 6522] [client 70.70.241.146:57247]   File "/opt/env/lib/python3.4/site-packages/django/conf/__init__.py", line 44, in _setup
[Tue Jan 26 00:37:50.841682 2016] [:error] [pid 6522] [client 70.70.241.146:57247]     self._wrapped = Settings(settings_module)
[Tue Jan 26 00:37:50.841715 2016] [:error] [pid 6522] [client 70.70.241.146:57247]   File "/opt/env/lib/python3.4/site-packages/django/conf/__init__.py", line 92, in __init__
[Tue Jan 26 00:37:50.841725 2016] [:error] [pid 6522] [client 70.70.241.146:57247]     mod = importlib.import_module(self.SETTINGS_MODULE)
[Tue Jan 26 00:37:50.842007 2016] [:error] [pid 6522] [client 70.70.241.146:57247]   File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
[Tue Jan 26 00:37:50.842054 2016] [:error] [pid 6522] [client 70.70.241.146:57247]     return _bootstrap._gcd_import(name[level:], package, level)
[Tue Jan 26 00:37:50.842088 2016] [:error] [pid 6522] [client 70.70.241.146:57247]   File "&lt;frozen importlib._bootstrap&gt;", line 2254, in _gcd_import
[Tue Jan 26 00:37:50.842112 2016] [:error] [pid 6522] [client 70.70.241.146:57247]   File "&lt;frozen importlib._bootstrap&gt;", line 2237, in _find_and_load
[Tue Jan 26 00:37:50.842135 2016] [:error] [pid 6522] [client 70.70.241.146:57247]   File "&lt;frozen importlib._bootstrap&gt;", line 2212, in _find_and_load_unlocked
[Tue Jan 26 00:37:50.842158 2016] [:error] [pid 6522] [client 70.70.241.146:57247]   File "&lt;frozen importlib._bootstrap&gt;", line 321, in _call_with_frames_removed
[Tue Jan 26 00:37:50.842181 2016] [:error] [pid 6522] [client 70.70.241.146:57247]   File "&lt;frozen importlib._bootstrap&gt;", line 2254, in _gcd_import
[Tue Jan 26 00:37:50.842203 2016] [:error] [pid 6522] [client 70.70.241.146:57247]   File "&lt;frozen importlib._bootstrap&gt;", line 2237, in _find_and_load
[Tue Jan 26 00:37:50.842225 2016] [:error] [pid 6522] [client 70.70.241.146:57247]   File "&lt;frozen importlib._bootstrap&gt;", line 2212, in _find_and_load_unlocked
[Tue Jan 26 00:37:50.842247 2016] [:error] [pid 6522] [client 70.70.241.146:57247]   File "&lt;frozen importlib._bootstrap&gt;", line 321, in _call_with_frames_removed
[Tue Jan 26 00:37:50.842269 2016] [:error] [pid 6522] [client 70.70.241.146:57247]   File "&lt;frozen importlib._bootstrap&gt;", line 2254, in _gcd_import
[Tue Jan 26 00:37:50.842291 2016] [:error] [pid 6522] [client 70.70.241.146:57247]   File "&lt;frozen importlib._bootstrap&gt;", line 2237, in _find_and_load
[Tue Jan 26 00:37:50.842313 2016] [:error] [pid 6522] [client 70.70.241.146:57247]   File "&lt;frozen importlib._bootstrap&gt;", line 2224, in _find_and_load_unlocked
[Tue Jan 26 00:37:50.842346 2016] [:error] [pid 6522] [client 70.70.241.146:57247] ImportError: No module named 'mysite'
</code></pre>

<p>And then in my hosts file:</p>

<pre><code>WSGIScriptAlias / /var/www/site/public_html/project/apache/wsgi.py
&lt;Directory "/var/www/site/public_html/project/apache"&gt;
    Require all granted
&lt;/Directory&gt;
Alias /static/ /var/www/site/public_html/app/static

&lt;Directory /var/www/site/public_html/app/static&gt;
    Require all granted
&lt;/Directory&gt;
</code></pre>

<p>And outside of the VirtualHost:</p>

<pre><code>WSGIPythonPath /var/www/site/public_html/:/opt/env/lib/python3.4/site-packages
</code></pre>

<p>Here is the <code>wsgi.py</code>:</p>

<pre><code>import os, sys

apache_configuration= os.path.dirname(__file__)
project = os.path.dirname(apache_configuration)
workspace = os.path.dirname(project)
sys.path.append(workspace)
sys.path.append(project)

sys.path.append('/var/www/site/public_html/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.apache.override'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
</code></pre>

<p>I've already tried <code>sudo apt-get install libapache2-mod-wsgi-py3</code>. I've already changed the python path. Not sure what else to try.</p>

<p>Where can I look to next?</p>

<p>I am on Ubuntu 14.</p>