title: How to fix Django "ModuleNotFoundError: No module named 'application'" on AWS?
body: <p>I am trying to redeploy a Django web application on AWS. My elastic beanstalk environment has been red a couple of times. When I ran eb logs on the cli, I am getting a &quot;ModuleNotFoundError: No module named 'application' error&quot;. I think this has got to do with my wsgi configuration.</p>
  <p>I have deployed this web app on AWS before. I messed up when I tried deploying a new version then decided to just start over. Here is my wsgi.py configuration:</p>
  <pre><code>```import os
  
  from django.core.wsgi import get_wsgi_application
  from django.contrib.staticfiles.handlers import StaticFilesHandler
  
  os.environ.setdefault(&quot;DJANGO_SETTINGS_MODULE&quot;, &quot;mysite.settings&quot;)
  
  application = StaticFilesHandler(get_wsgi_application())```
  </code></pre>
  <p>When I deploy the app, it's giving me a 502: Bad gateway error. Let me know if you would like more info on the issue. Any pointers would be greatly appreciated.</p>