Context processors

add_dynamicforms_settings(request: django.http.request.HttpRequest)[source]

context processor that adds DynamicForms configuration variables to template context

Example for supporting different versions of bootstrap:

{% if DYNAMICFORMS.bootstrap_version == 'v3' %}
  {% set_var card_class='panel panel-default' card_header='panel-heading' card_body='panel_body' %}
{% else %}
  {% set_var card_class='card' card_header='card-header' card_body='card-body' %}
{% endif %}


Using DynamicForms renderers automatically adds this variable into the context as it is required by template packs.

Parameters:request – see django documentation
Returns:dict with DYNAMICFORMS context variable set