Django website DisallowedHost error

I followed the tutorial here: I am getting the DisallowedHost error when trying to visit my web app at

I’ve tried adding the name of the site to allowed hosts to no avail. Right now I’m using DJANGO_ALLOWED_HOSTS as an environment variable, with ${APP_DOMAIN} as the value as the tutorial tells me to do, but it’s not working.

Any help with this would be appreciated.

Kind regards,


Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Site Moderator
Site Moderator badge
March 11, 2022

Hi @,

Just to be sure, confirm you’ve configured the following part of the tutorial as well:

For your Django app to function, you need to set the following environment variables like so:


    • This allows us to know the randomly generated URL that App Platform provides and provide it to our app

    • In this case, we’ll name our database db in the next step, so this should be ${db.DATABASE_URL}
  • DEBUG -> True

    • Set this to True for now to verify your app is functioning and set to False when it’s time for this app to be in production DJANGO_SECRET_KEY -> <A RANDOM SECRET KEY> You can either allow your app to generate this at every launch or pick a strong password with at least 32 characters to use as this key. Using a secure password generator is a good option for this
    • Don’t forget to click the Encrypt check box to ensure that your credentials are encrypted for safety