[Django]-Django set multiple allowed hosts

12👍

You can provide a delimiter then split the string in django

ALLOWED_HOSTS = env('DJANGO_ALLOWED_HOSTS').split(',')
heroku config:set 'DJANGO_ALLOWED_HOSTS' = 'www.example.com,foo.com'
👤Sayse

6👍

To define multiple values for allowed hosts in settings.py file use like:

ALLOWED_HOSTS = [‘000.08.10.11′,’111.22.33.44′,’www.abcdefgh.com’]

👤prachi

Leave a comment