开发者

Where and how do I set an environmental variable using mod-wsgi and django?

开发者 https://www.devze.com 2023-01-08 23:12 出处:网络
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.In you app.wsgi file do:

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.


In you app.wsgi file do:

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


The reference material is here. But the operative line for your project path (in case that's what you mean) is:

sys.path.append('/path/to/project')

However, your template path is set within your settings.py file:

TEMPLATE_DIRS = ( '/path/to/templatedir1', '/path/to/templatedir2' )
0

精彩评论

暂无评论...
验证码 换一张
取 消