小编b-r*_*rat的帖子

Django"TemplateDoesNotExist"错误但"使用loader django.template.loaders.app_directories.Loader"文件存在

Template Loader找到模板但未加载模板

TemplateDoesNotExist at /cardpayment/

cardpayment.html

Request Method:     GET
Request URL:    http://localhost:7000/cardpayment/
Django Version:     1.8
Exception Type:     TemplateDoesNotExist
Exception Value:    

cardpayment.html

Exception Location:     /home/sdr/sl/lib/python3.4/site-packages/django/template/loader.py in render_to_string, line 138
Python Executable:  /home/sdr/sl/bin/python
Python Version:     3.4.3
Python Path:    

['/home/sdr/sl/agryp',
 '/home/sdr/pycharm-4.0.6/helpers/pydev',
 '/home/sdr/sl/src/tastypie',
 '/home/sdr/sl/agryp',
 '/usr/local/lib/python34.zip',
 '/usr/local/lib/python3.4',
 '/usr/local/lib/python3.4/plat-linux',
 '/usr/local/lib/python3.4/lib-dynload',
 '/home/sdr/sl/lib/python3.4/site-packages']

Server time:    Tue, 5 May 2015 10:17:40 +0000
Template-loader postmortem

Django tried loading these templates, in this order:

    Using loader django.template.loaders.filesystem.Loader:
        /home/sdr/sl/agryp/templates/cardpayment.html (File does not exist)
    Using loader django.template.loaders.app_directories.Loader:
        /home/sdr/sl/agryp/agryp/templates/cardpayment.html (File exists) <=========== FILE EXISTS …
Run Code Online (Sandbox Code Playgroud)

python django django-templates

4
推荐指数
3
解决办法
2万
查看次数

标签 统计

django ×1

django-templates ×1

python ×1