0

The server is working fine, however while using extend for this 'home.html' file unable to link the template :

In 'home.html':

{ % extends "/template1/personal/header.html" % } While loading localhost: Django tried loading these templates, in this order:

`Using engine django:

  1. django.template.loaders.app_directories.Loader: /usr/local/lib/python2.7/dist-packages/django/contrib/admin/templates/ffgg/home.html (Source does not exist).
  2. django.template.loaders.app_directories.Loader: /usr/local/lib/python2.7/dist-packages/django/contrib/auth/templates/ffgg/home.html (Source does not exist)`
Shivam Mishra
  • 51
  • 1
  • 6
  • 2
    Possible duplicate of [Django TemplateDoesNotExist?](https://stackoverflow.com/questions/1926049/django-templatedoesnotexist) – ayrusme Oct 21 '17 at 05:23
  • Please post the content of the TEMPLATE_DIRS Variable in your settings.py – rollinger Oct 21 '17 at 08:58
  • Don't use an absolute path (unless your template is really in that directory, starting from root). –  Oct 21 '17 at 09:22

1 Answers1

0

1) Check what is in TEMPLATE_DIRS Variable in settings.py. That is the folder Django looks up in every app in order to find your template.

2) Try remove the leading slash:

{% extends 'template1/personal/header.html' %}

3) if template1 is in TEMPLATE_DIRS, then 'app/template.html' would be enough

{% extends 'personal/header.html' %}

Read on:

https://tutorial.djangogirls.org/en/template_extending/

https://docs.djangoproject.com/en/1.7/topics/templates/

rollinger
  • 531
  • 1
  • 4
  • 15