title: Error running wsgi application: ModuleNotFoundError
body: <p>I am trying to host my local web app on pythonanywhere. [<em>Beginner to Django and web-development</em>]</p>
  <p>I am facing the following error while launching the app:</p>
  <pre><code>Error running WSGI application
  2021-04-26 21:46:32,020: ModuleNotFoundError: No module named 'myapp'
  2021-04-26 21:46:32,020:   File &quot;/var/www/username_pythonanywhere_com_wsgi.py&quot;, line 16, in &lt;module&gt;
  2021-04-26 21:46:32,020:     application = get_wsgi_application()
  2021-04-26 21:46:32,020: 
  2021-04-26 21:46:32,020:   File &quot;/home/username/.virtualenvs/web-virtualenv/lib/python3.8/site-packages/django/core/wsgi.py&quot;, line 12, in get_wsgi_application
  2021-04-26 21:46:32,020:     django.setup(set_prefix=False)
  2021-04-26 21:46:32,020: 
  2021-04-26 21:46:32,020:   File &quot;/home/username/.virtualenvs/web-virtualenv/lib/python3.8/site-packages/django/__init__.py&quot;, line 19, in setup
  2021-04-26 21:46:32,021:     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  2021-04-26 21:46:32,021: 
  2021-04-26 21:46:32,021:   File &quot;/home/username/.virtualenvs/web-virtualenv/lib/python3.8/site-packages/django/conf/__init__.py&quot;, line 82, in __getattr__
  2021-04-26 21:46:32,021:     self._setup(name)
  2021-04-26 21:46:32,021: 
  2021-04-26 21:46:32,021:   File &quot;/home/username/.virtualenvs/web-virtualenv/lib/python3.8/site-packages/django/conf/__init__.py&quot;, line 69, in _setup
  2021-04-26 21:46:32,021:     self._wrapped = Settings(settings_module)
  2021-04-26 21:46:32,021: 
  2021-04-26 21:46:32,021:   File &quot;/home/username/.virtualenvs/web-virtualenv/lib/python3.8/site-packages/django/conf/__init__.py&quot;, line 170, in __init__
  2021-04-26 21:46:32,021:     mod = importlib.import_module(self.SETTINGS_MODULE)
  </code></pre>
  <p>File locations:</p>
  <p>The settings.py file is located at:</p>
  <pre><code>/home/username/WebDev/Website/Django/MyApp/myapp/myapp
  </code></pre>
  <p>I have modified '/var/www/username_pythonanywhere_com_wsgi.py' file as:</p>
  <pre><code>&quot;&quot;&quot;
  WSGI config for myapp project.
  
  It exposes the WSGI callable as a module-level variable named ``application``.
  
  For more information on this file, see
  https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
  &quot;&quot;&quot;
  
  import os
  import sys
  sys.path.append(&quot;/home/username/WebDev/Website/Django/MyApp/myapp&quot;)
  
  os.environ('DJANGO_SETTINGS_MODULE', 'myapp.settings')
  
  from django.core.wsgi import get_wsgi_application
  application = get_wsgi_application()
  </code></pre>
  <p>I have looked at the similar question on stackoverflow but still cant figure out what is wrong at my end.</p>
  <p>Any pointers/help would be appreciated.</p>