ALLOWED_HOSTS not working in my Django App deployed to Elastic Beanstalk

Question:

I deployed a Django App to AWS Elastic Beanstalk and I’m getting “Invalid HTTP_HOST header” error even when I’ve added it to my allowed hosts settings.

I’m getting this error:

This is what I have in my settings.py

settings.py:

I think the problem is that my settings aren’t being updated, because isn’t working either if I put ALLOWED_HOSTS = ['*']. I left DEBUG = True and in request information I’m getting: ALLOWED_HOSTS: ['localhost']

after modifying it I run eb deploy without errors.

Answer:

I’ve realized that my changes wasn’t being deployed because I needed to commit first and I didn’t know that (my first time deploying to eb). So, that was the problem.

Leave a Reply