0👍
✅
render returns an instance of HttpResponse
, you can access the html content via response.content
.
response = another_view(request)
rendered_html_text = response.content
Doc of HttpResponse
Updated: It’s better to define your base.html
and extend it, put what in common to base.
1👍
The right way to deal with site-wide content is to write custom templatetags so views don’t have to deal with it. You views should only deal with view-specific stuff.
- [Answer]-Django multiple database for multiple organisation in a single project
- [Answer]-Django Test Client does not create a user object but creates a anonymous user object
- [Answer]-Add Django-Simple-Captcha in contact area
Source:stackexchange.com