现在的位置: 首页 > 综合 > 正文

django book笔记–问题2(chapter4 importError)

2016年02月25日 ⁄ 综合 ⁄ 共 398字 ⁄ 字号 评论关闭

第四章 模板--导入模板部分

“In order to use this template-loading API, first you’ll need to tell the framework where you store your templates. The place to do this is in your settings file
– the 
settings.py file that we mentioned last chapter, when we
introduced the 
ROOT_URLCONF setting.”

(课本中提到需要在setting.py中设置ROOT_URLCONF,如果设置不正确就会出错误)

在前两章的内容中我们已经见过这个设置,但是此外我们还对urls.py进行了设置,如果你直接使用前一次的urls.py就会出现如下图所示的错误:


因此你需要将urls.py import hello 的语句删除,出现下图的错误才是正确的:



抱歉!评论已关闭.