1👍
✅
Put i
into the context that you use to render the HTML output. Then you can access it with the syntax {{ i }}
inside the template.
At the end of your view:
return render("some_template.html", {'i': i})
and in the view:
<p>Do you like {{ i }}?</p>
0👍
You can create a custom template tag.
https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#simple-tags
- [Answer]-Django acces the setting given in –settings argument on runserver in program
- [Answer]-Save in two or more models at the same time with form_valid
- [Answer]-Django – sorting foreign key objects by date
Source:stackexchange.com