The difficulty I have is precisely described in
but the answer given there, accepted by the OP, is given in the “recipe” spirit,
as are an incredible number of others I found, concerning the same issue.
Even the django official documentation, having to document an enormously vast field,
suffers from this disease.
So, since I would like not the fish but the fishing rod, please let me restate the question in my terms:
I have a father template and children templates, the latter all filling one block defined
in the father template, one at a time.
The father template is rendered by calling a father-view in father.py, with a father-context, and the view-template relation for the father is given by a line in some urls.py file. This fills up the upper part of the browser screen with some type of “summary data”.
When this is done, it is time to fill up the lower part, with different types of detail information, one at a time of course. I do this with different children views, using in the father-template lines like
{% url ‘djangoapp:details1’ param1_a’%}
or
{% url ‘djangoapp:details2’ param2_a param2_b param2_c %}
and so on.
These “children views” all generate different “children contexts”, each one of which
is sent to its own “child template”, “{% extend %}” ing the “father template” above.
This works, in the sense that it fills the lower part of my page, but the upper page at this point is full of blank spaces.
I can only guess, this is because the children-contexts do not contain any of the variables I use in the upper part of my page. So I ask:
-
Is my interpretation correct or am I doing some mistakes? and, if yes,
-
Am I to fix this by passing in the “url” lines above all parameters received from the father template, totally unneeded by the children views, just for having the children views include them in their children contexts for final transmission to the children templates? (This is, in essence, what the OP was answered in the question in the link above.)
But they are more than 2 or 3, and would clutter everything: the “url” lines above,
the definition of the children views, and also the description lines in the urls.py file.
Since my case seems common enough, I find strange that the django system
of “template inheritance” was not completed by “context inheritance” of some kind.
Thank you for answers, or suggestions.