I use django 1.11 and this is my wsgi.py file
# -*- coding: utf-8 -*-
import os
import sys
from django.core.wsgi import get_wsgi_application
PATH = os.path.abspath(
os.path.join(os.path.dirname(os.path.abspath(__file__))))
if PATH not in sys.path:
sys.path.append(PATH)
os.environ['DJANGO_SETTINGS_MODULE'] = 'cms.settings.qa'
ENV_VARIABLES_TO_PASS = ['VAR_1', 'VAR_2']
_application = get_wsgi_application()
def application(environ, start_response):
# pass the WSGI environment variables on thzrough to os.environ
for var in ENV_VARIABLES_TO_PASS:
os.environ[var] = environ.get(var, '1')
return _application(environ, start_response)
and when i try to get the env on settings file its allways return None.
os.getenv('VAR_1') = None & os.getenv('VAR_2') = None
why is that happend? thanks a lot.