I'm facing the following issue. My .env files contains a line like:
export SERVERNAMES="localhost domain1 domain2 domain3" <- exactly this kind of format
But the variable called SERVERNAMES is used multiple times at multiple locations of my deployment so i can't declare this as compatible list of strings that settings.py can use imidiatly. beside I don't like to set multiple variables of .env for basically the same thing. So my question is how can I format my ALLOWED_HOSTS to be compatible with my settings.py. Something like this does not seem to work it seems:
ALLOWED_HOSTS = os.environ.get('SERVERNAMES').split(',')
Thanks and kind regards