I have built a Django app that is hosted on Elastic Beanstalk. Everything is fine when I directly leave in my settings ALLOWED_HOSTS = ["nameofmysite.com"] but when I replace this by an env. variable (a classical "os.environ.get" that works fine with all other env variable in the project) and that I fill this env. variable in my Beanstalk configuration, I get a 500 error. I've looked into tutorials and actually all of these do not put ALLOWED_HOST as an env. variable, they just leave it in the project. https://testdriven.io/blog/django-elastic-beanstalk/ for example. Just wondering if this is normal and if there is a fix.
The second problem that I encounter is that when I remove ALLOWED_HOSTS = ["*"] for ALLOWED_HOSTS = ["nameofmysite.com"], I manage to access https://nameofmysite.com/ but cannot access https://WWW.nameofmysite.com/. Wondering if it isn't a problem related to my Route 53 config rather than ALLOWED_HOSTS configuration. Thanks a lot