The decorators in :mod:`django.views.decorators.predicate` can be used to restrict the view selection based on a function result.