0π
β
The data is passed as object
to the context, as as con2
, so you render this with:
{% block context %} <h4>{{ con2.name }}</h4> <h4>{{ con2.address }}</h4> {% endblock context %}
The variable name of home.html
is thus not somehow reused: after rendering the template, the context is no longer available. If the user clicks on another link, then it will visit that view, and thus restart the rendering process with a new context.
1π
Try to write con2.name
and con2.address
. Because you are in the index_detail page an you mentioned con2 in view not a T1
π€Abdusamad
- [Answered ]-How to use select_related in templates Django?
- [Answered ]-Django : value too long for type character varying(30) when input not even 10 characters
- [Answered ]-How does Django generates uuid?
- [Answered ]-Django how to reverse to autocreated page
Source:stackexchange.com