【发布时间】:2014-08-09 00:20:21
【问题描述】:
【问题讨论】:
标签: html django templates runnable
【问题讨论】:
标签: html django templates runnable
您需要像代码注释所说的那样在 Django Settings (Settings.py) 中设置 TEMPLATE_DIRS var,以让 Django 成功获取所有模板。
将os.path.join(os.path.dirname(__file__),"templates")放入变量中,并在python中导入os.path。在您的应用文件夹中创建一个模板文件夹,并将所有 .html 文件移到那里。
【讨论】: