“os.environ” in django settings.py cannot get system environment variables with apache and wsgi

前端 未结 2 1750
名媛妹妹
名媛妹妹 2021-01-18 18:32

I set up the django setting.py like this:

import os
from django.core.exceptions import ImproperlyConfigured
def get_env_variable(var_name):
    try:
                 


        
2条回答
  •  失恋的感觉
    2021-01-18 18:38

    whatever environments you are setting in the settings.py will be applied for that instance's environment variables only, they are not changing the system env variables which will be called apache.

提交回复
热议问题