1👍
✅
Does your base.html contain {% block test %}?
Your base template must contain the block you want to override. You can add additional blocks in child templates, but they must be contained within a base block.
See https://docs.djangoproject.com/en/dev/topics/templates/#template-inheritance
0👍
base.html
is your top level template. This would normally be the thing that starts with an html doctype
and ends with a </html>
tag. Everything else has to have a place to go in there. All you have is a content
block.
So where would the test
block go? You’ve tried to put it in page1.html
, but it still needs a place to go in the parent template.
- [Answer]-Edit related object using ModelFormSet
- [Answer]-Django limiting file size and file format in view
- [Answer]-Django Models: Should a relatives model refer to itself through ForeignKey or ManyToMany?
- [Answer]-Django querying multiple tables – passing parameters to the query
- [Answer]-Where to store software generated user-specific image files in Python Django?
Source:stackexchange.com