[Django]-I get an Error 400: Bad Request on custom Heroku domain, but works fine on foo.herokuapp.com

48👍

You have to set your website domain as an allowed host. Place this in your ./app/settings/settings.py:

ALLOWED_HOSTS = [".herokuapp.com", ".researchthroughdesign.org"]

In production you can even remove .herokuapp.com

9👍

heroku config:set DJANGO_ALLOWED_HOSTS=.example.com,example.herokuapp.com

0👍

It was answered already but I just wanted to add if you are changing the app name on Heroku right after you change the git remote also make sure to do what was answered by @Leo because I was also struggling to why it was showing 400 response on the browser until I found this question.

👤ZaMy

Leave a comment