{% with object.as_form as form %} {% if object.enable_csrf %} {% csrf_token %} {% endif %} {{ form.as_p }} {% endwith %}