Django Template does not exist error, although it shows 'file exists'

后端 未结 3 961
抹茶落季
抹茶落季 2020-12-10 07:26

I am not able to render any html pages in Django 1.7. My \'index.html\' is in \'project/seatalloc/templates/index.html\' and my view.py in proje

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-10 08:08

    If - as in your case - you get a TemplateDoesNotExist error and the debug page states "File exists" next to the template in question this usually (always?) means this template refers to another template that can't be found.

    In your case, index.html contains a statement ({% extends %}, {% include %}, ... ) referring to another template Django cannot find. Unfortunately, as of Django 1.8.3, the debug page always names the base template, not the one Django can't find.

提交回复
热议问题