Problems deploying a Django app for Amazon AWS Elastic Beanstalk

I know this question has been asked a lot, but none of the solutions work for me. I am trying to deploy a Django 1.8 web app in an elastic beanstalk. It works when Debug is set to True, but not when it is set to False. This is a brand new application that I haven't done anything other than changing the debug mode. I tried:

ALLOWED_HOSTS = ['*']
ALLOWED_HOSTS = ['127.0.0.1', 'localhost']
ALLOWED_HOSTS = ['.elasticbeanstalk.com', 'elasticbeanstalk.com.']
ALLOWED_HOSTS = ['RDS_HOSTNAME']
ALLOWED_HOSTS = ['.ec2-52-10-0-17.us-west-2.compute.amazonaws.com']
ALLOWED_HOSTS = [
    '.revchip.elasticbeanstalk.com'
    'revchip.elasticbeanstalk.com.'
]
ALLOWED_HOSTS = ['revchip.elasticbeanstalk.com', 'ec2-52-10-0-17.us-west-2.compute.amazonaws.com']

      

In some solutions it gives a Bad Request 400 error, but with some others what it does. The requested URL / was not found on this server. for example if i do [* *] solution

+3


source to share


1 answer


Hi I had exactly the same problem and luckily it was solved by pasting the parent directory of the project into sys.path on wsgi.py

import sys, os
sys.path.insert(0, '/opt/python/current/app')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'your.settings')

      



hope this helps.

+1


source







All Articles