[Django]-Extend base.html problem

22👍

“At the same place” as yoga/index.html means that the template is actually yoga/base.html.

18👍

Assuming TEMPLATE_DIRS contains /home/mo/python/django/templates/, without the .../yoga/, so you need to:

move base.html into /home/mo/python/django/templates/

OR

write {% extends "yoga/base.html" %} in your template

5👍

Is base.html in a directory in the TEMPLATE_DIRS list in your settings file?

1👍

Base.html file must be located at the base of templates folder to use ‘ base.html ‘ , if located in another folder such as: templates / home / base.html , then you must specify the path using

{ % Extends ' home / base.html '% }

Leave a comment