在这个文件中可以配置TEMPLATE_DIRS来自定义模块目录,但是注释中说一定要使用绝对路径。因为会在不同的电脑上开发同一个项目,请问大家怎么解决这个文件在版本库中的问题?
1
xiaket Apr 18, 2012
app下面建templates目录就行了?
|
3
c Apr 18, 2012
import os
TEMPLATE_DIRS = ( os.path.join(os.path.dirname(__file__), 'templates'), ) |
4
bhuztez Apr 18, 2012
你随便搜一下就知道了,一般建议类似这样
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) TEMPLATE_DIRS = ( os.path.join(PROJECT_PATH, 'templates'), ) |