published by | Adam Johnson |
---|---|
in blog | Adam Johnson |
original entry | Django: hoist repeated decorator definitions |
Django provides us with a rich set of view decorators. In this post, we’ll look at a technique for hoisting repeated use of these decorators to reduce repetition.
@cache_control
callsHere are two public views with the same @cache_control
decorator:
from django.views.decorators.cache import cache_control
@cache_control …