djblets.features.decorators¶
Feature-related decorators.
-
feature_required
(feature, not_enabled_view=None)[source]¶ Require a feature to execute a view.
If the feature is not enabled, the
not_enabled_view
will be called instead.Parameters: - feature (djblets.features.feature.Feature) – The feature that must be enabled.
- not_enabled_view (callable) – The view that will be called when the feature is not enabled. This defaults to a view that returns an HTTP 404 Not Found.
Returns: The decorator.
Return type: callable