Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14301

how to add multiple domains into DJANGO_ALLOWED_HOSTS as an environment variable

$
0
0

in django 4.1 application I'm trying to add several allowed hosts in my .env file as an environment variable like this -> DJANGO_ALLOWED_HOST=synapse-developmentcenter.am www.synapse-developmentcenter.am 127.0.0.1 localhost 0.0.0.0but only first domain working correctly and after echo $DJANGO_ALLOWED_HOST shows only synapse-developmentcenter.am and here is my settings.py line addressing .env file ->

ALLOWED_HOSTS = []if not DEBUG:    ALLOWED_HOSTS += os.environ.get('DJANGO_ALLOWED_HOST').split('')

running cat .env showing correctly and when trying to export it again only first domain getting there for the rest it shows -> bash: export: 127.0.0.1': not a valid identifier`

I tried change variable types to this -> [DJANGO_ALLOWED_HOST=synapse-developmentcenter.am www.synapse-developmentcenter.am 127.0.0.1 localhost 0.0.0.0] or["DJANGO_ALLOWED_HOST=synapse-developmentcenter.am www.synapse-developmentcenter.am 127.0.0.1 localhost 0.0.0.0"] even like this -> DJANGO_ALLOWED_HOST="synapse-developmentcenter.am www.synapse-developmentcenter.am 127.0.0.1 localhost 0.0.0.0" but neither of them worked


Viewing all articles
Browse latest Browse all 14301

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>