Pythonanywhere - ImportError: No module named 'myapp.settings'
<p>Using Python 3.5 and Django 1.9, I was trying to deploy my app to pythonanywhere, but I keep getting this error</p>

<pre><code>2016-10-07 01:44:28,879 :Error running WSGI application
Traceback (most recent call last):
  File "/bin/user_wsgi_wrapper.py", line 154, in __call__
    app_iterator = self.app(environ, start_response)
  File "/bin/user_wsgi_wrapper.py", line 170, in import_error_application
    raise e
  File "/bin/user_wsgi_wrapper.py", line 154, in __call__
    app_iterator = self.app(environ, start_response)
  File "/bin/user_wsgi_wrapper.py", line 170, in import_error_application
    raise e
  File "/bin/user_wsgi_wrapper.py", line 179, in &lt;module&gt;
    application = load_wsgi_application()
  File "/bin/user_wsgi_wrapper.py", line 175, in load_wsgi_application
    return __import__(os.environ['WSGI_MODULE'], globals(), locals(), ['application']).application
  File "/var/www/nidalmer_pythonanywhere_com_wsgi.py", line 21, in &lt;module&gt;
    application = StaticFilesHandler(get_wsgi_application())
  File "/home/nidalmer/trailersapp/myvenv/lib/python3.5/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
    django.setup()
  File "/home/nidalmer/trailersapp/myvenv/lib/python3.5/site-packages/django/__init__.py", line 17, in setup
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  File "/home/nidalmer/trailersapp/myvenv/lib/python3.5/site-packages/django/conf/__init__.py", line 55, in __getattr__
    self._setup(name)
  File "/home/nidalmer/trailersapp/myvenv/lib/python3.5/site-packages/django/conf/__init__.py", line 43, in _setup
    self._wrapped = Settings(settings_module)
  File "/home/nidalmer/trailersapp/myvenv/lib/python3.5/site-packages/django/conf/__init__.py", line 99, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/home/nidalmer/trailersapp/myvenv/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named 'trailersapp.settings'
</code></pre>

<p>Here is my <strong>wsgi.py</strong> file</p>

<pre><code>import os

import sys

path = '/home/nidalmer/trailersapp/trailers/settings.py'

if path not in sys.path:
    sys.path.append(path)

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "trailers.settings")

application = get_wsgi_application()
</code></pre>

<p>and my tree:</p>

<pre><code>trailersapp
âââ db.sqlite3
âââ manage.py
âââ movies
â   âââ __init__.py
â   âââ __pycache__
â   âââ admin.py
â   âââ apps.py
â   âââ forms.py
â   âââ migrations
â   âââ models.py
â   âââ templates
â   âââ tests.py
â   âââ urls.py
â   âââ views.py
âââ myvenv
âââ requirements.txt
âââ static
â   âââ admin
â   âââ movies
âââ trailers
    âââ __init__.py
    âââ __pycache__
    âââ settings.py
    âââ urls.py
    âââ wsgi.py
</code></pre>

<p>I can't tell where the error is coming from since my wsgi file says trailers.settings and not trailersapp.settings and I don't have that anywhere. </p>

<p>Any help would be appreciated!</p>

<p>The path in your wsgi file is wrong. It's supposed to be the path to your app, so:</p>

<pre><code>path = '/home/nidalmer/trailersapp'
</code></pre>

<p>Also, I think you're looking at an old traceback or an old copy of the wsgi file. Make sure they're both up-to-date.</p>

python django pythonanywhere