{% formconfig %} only works in the context of a {% form %} tag. To know whether it's in such a context, it checks for the presence of a particular context variable (_form_render).
Unfortunately, if only is set on a {% form %} tag, the _form_render variable is not passed in (because it's set as part of the outer context rather than the inner context.)
I believe the solution would be as simple as setting _form_render in get_extra_context instead of in render.
{% formconfig %}
only works in the context of a{% form %}
tag. To know whether it's in such a context, it checks for the presence of a particular context variable (_form_render
).Unfortunately, if
only
is set on a{% form %}
tag, the_form_render
variable is not passed in (because it's set as part of the outer context rather than the inner context.)I believe the solution would be as simple as setting
_form_render
inget_extra_context
instead of inrender
.