django_program.context_processors

Django context processors for django-program.

Functions

program_features(request)

Expose resolved feature toggle flags to templates.

django_program.context_processors.program_features(request)[source]

Expose resolved feature toggle flags to templates.

Each flag is resolved through is_feature_enabled() so that master-switch overrides (e.g. all_ui_enabled) are applied. When the request carries a conference attribute (set by middleware or the view), per-conference DB overrides are included in the resolution.

Add "django_program.context_processors.program_features" to the context_processors list in your TEMPLATES setting.

Usage in templates:

{% if program_features.registration_enabled %}
    <a href="{% url 'registration:ticket-list' %}">Registration</a>
{% endif %}
Parameters:

request (HttpRequest)

Return type:

dict[str, dict[str, bool]]