TemplateDoesNotExist core/home1.html

Raised by:

django/template/loader.py (line 194)

Traceback (most recent call last):
  File "python2.7/site-packages/django/core/handlers/base.py", line 137, in get_response
    response = response.render()
  File "python2.7/site-packages/django/template/response.py", line 103, in render
    self.content = self.rendered_content
  File "python2.7/site-packages/django/template/response.py", line 78, in rendered_content
    template = self.resolve_template(self.template_name)
  File "python2.7/site-packages/django/template/response.py", line 54, in resolve_template
    return loader.select_template(template)
  File "python2.7/site-packages/django/template/loader.py", line 194, in select_template
    raise TemplateDoesNotExist(', '.join(not_found))
TemplateDoesNotExist: core/home1.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