在哪里和如何使用mod-wsgi和django设置一个环境变量? [英] Where and how do I set an environmental variable using mod-wsgi and django?

查看:106
本文介绍了在哪里和如何使用mod-wsgi和django设置一个环境变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用这个env变量来指定我的模板的路径,使用git或svn可能会更容易。

I'm trying to use this env variable to specify the path for my templates and it will probably be easier to do this using git or svn.

推荐答案

在您 app.wsgi 文件中:

import os
os.environ['MY_ENV_VARIABLE'] = 'value'
# e.g. os.environ['MPLCONFIGDIR'] = '/path/to/config/dir'

这篇关于在哪里和如何使用mod-wsgi和django设置一个环境变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆