chenxin6676 发表于 2015-05-04 15:57

Django的TEMPLATE_DIRS配置疑问



django 1.8 windows下的
TEMPLATE_DIRS = (
    r'C:\Users\xin\Desktop\web_project\assets_yunwei\templates',
    #'./templates',
    #os.path.join(BASE_DIR,'templates'),
    #os.path.join(os.path.dirname(__file__), 'templates').replace('\\','/'),
)
不生效,谁知道怎么回事呢?哪里不对,应该如何配置哦?

huangxiaohen 发表于 2015-05-04 18:58

你可以使用最后一种,保证templates在app的目录下,就可以了

chenxin6676 发表于 2015-05-05 11:50

回复 2# huangxiaohen


    非常感谢!{:yxh53:}

HH106 发表于 2015-05-05 15:06

回复 1# chenxin6676 使用 / 而不是 \
页: [1]
查看完整版本: Django的TEMPLATE_DIRS配置疑问