django渲染快捷方式无法找到模板

时间:2013-10-02 08:39:03

标签: django templates render

感谢任何人的帮助。我的django找不到模板文件

Template loader Error:
Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.Loader:
Using loader django.template.loaders.app_directories.Loader:
/usr/local/lib/python2.7/dist-packages/django/contrib/auth/templates/rmdemo/rib.html (File      does not exist)
/home/shepherd/artekcloud/media/rmdemo/nodegraph/templates/rmdemo/rib.html (File does not exist)
/home/shepherd/artekcloud/media/rmdemo/rmdemo/templates/rmdemo/rib.html (File does not exist)
/home/shepherd/artekcloud/media/rmdemo/minikatana/templates/rmdemo/rib.html (File does not exist)
/usr/local/lib/python2.7/dist-packages/django/contrib/admin/templates/rmdemo/rib.html (File does not exist)

这是追溯

Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response 115.  response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/shortcuts/__init__.py" in render  53.     return HttpResponse(loader.render_to_string(*args, **kwargs),
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in render_to_string 170.         t = get_template(template_name)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in get_template  146.     template, origin = find_template(template_name)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in find_template 139.     raise TemplateDoesNotExist(name)

Exception Type: TemplateDoesNotExist at /rmdemo/rib/
Exception Value: rmdemo/rib.html

我使用渲染快捷方式渲染模板

return render(request,'rmdemo/rib.html', {'loggedin': loggedin})

有关这种情况如何发生的任何想法?为什么django在应用程序文件夹中查找媒体文件夹而不是模板文件夹?

我很确定模板文件位于app文件夹下。

0 个答案:

没有答案