I have a particularly difficult look, which may need to send a message about the form several times, but I need a header right away.
Is there any way to return part of the template header? for example, my view returns something like:
return HttpResponse(Template('
{% extends "base.html" %}
{% block content %} FOO {% endblock %}
'))
Ideally, I want to be able to do something like:
partialResponse = request.renderUntilBlock('content')
return partialResponse.extend(Template('
{% block content %} FOO {% endblock %}
'))
Update: Obviously, PHP is structured differently, but this is what I hope to emulate:
<?php
echo '<html><head><title>Hi!</title</head><body>';
ob_flush(); flush();
echo '<h1>done</h1></body></html>';
?>
source
share