TemplateDoesNotExist home.html

Raised by:

django/template/loader.py (line 76)

Traceback (most recent call last):
  File "python2.7/site-packages/django/core/handlers/base.py", line 164, in get_response
    response = response.render()
  File "python2.7/site-packages/django/template/response.py", line 158, in render
    self.content = self.rendered_content
  File "python2.7/site-packages/django/template/response.py", line 133, in rendered_content
    template = self._resolve_template(self.template_name)
  File "python2.7/site-packages/django/template/response.py", line 88, in _resolve_template
    new_template = self.resolve_template(template)
  File "python2.7/site-packages/django/template/response.py", line 78, in resolve_template
    return loader.select_template(template, using=self.using)
  File "python2.7/site-packages/django/template/loader.py", line 76, in select_template
    raise TemplateDoesNotExist(', '.join(template_name_list))
TemplateDoesNotExist: home.html

How to reproduce

Try to use a template that does not exist in your project.

For example, add the following to your urls.py, and try to access /error/:

from django.views.generic import TemplateView

urlpatterns = [
    url(r'^error$', TemplateView.as_view(template_name='blablabla.html'), name='index'),

How to fix

  • Verify if there are any spell errors in your template name.
  • Verify if the path to your template is correct.
  • Verify if your template is correctly placed in a templates folder of one of your apps.
  • Verify if your template folder is correctly listed in the templates DIRS.
  • Verify if the app template where template belongs is on INSTALLED_APPS