title: Elastic Beanstalk: No module named settings
body: <p>I am trying to run a django app on Amazon Elastic Beanstalk and I'm following <a href="http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html#python-django-configure-for-eb" rel="noreferrer">this</a> tutorial.</p>
  
  <p>However, when deploying, I get a 500 error, and when looking at the logs:</p>
  
  <pre><code>ImportError: No module named settings
  [Tue Sep 06 15:22:32.138981 2016] [:error] [pid 1940] [remote 127.0.0.1:42845] mod_wsgi (pid=1940): Target WSGI script '/opt/python/current/app/fasttext/wsgi.py' cannot be loaded as Python module.
  [Tue Sep 06 15:22:32.139006 2016] [:error] [pid 1940] [remote 127.0.0.1:42845] mod_wsgi (pid=1940): Exception occurred processing WSGI script '/opt/python/current/app/fasttext/wsgi.py'.
  </code></pre>
  
  <p>It seems like my wsgi.py file is the issue:</p>
  
  <pre><code>"""
  WSGI config
  
  It exposes the WSGI callable as a module-level variable named ``application``.
  
  For more information on this file, see
  https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
  """
  
  import os
  
  from django.core.wsgi import get_wsgi_application
  
  os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
  
  application = get_wsgi_application()
  </code></pre>
  
  <p>I read many topics on SO and other sites, but none of the solutions worked for me. </p>
  
  <p>Here is my .ebextensions/django.config file:</p>
  
  <pre><code>option_settings:
    aws:elasticbeanstalk:container:python:
      WSGIPath: fasttext/wsgi.py
  </code></pre>
  
  <p>Does anyone know how to fix this ? </p>
  
  <p>Thanks</p>