Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
django渲染快捷方式找不到模板_Django_Templates_Render - Fatal编程技术网

django渲染快捷方式找不到模板

django渲染快捷方式找不到模板,django,templates,render,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-pa

谢谢任何人的帮助。我的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文件夹下

请将
TEMPLATE\u DIRS
TEMPLATE\u LOADERS
设置的值(从
settings.py
文件)添加到您的帖子中。这将使事情变得更加清楚,并显示模板的实际位置。