Function | async_only_middleware |
Mark a middleware factory as returning an async middleware. |
Function | decorator_from_middleware |
Given a middleware class (not an instance), return a view decorator. This lets you use middleware functionality on a per-view basis. The middleware is created with no params passed. |
Function | decorator_from_middleware_with_args |
Like decorator_from_middleware, but return a function that accepts the arguments to be passed to the middleware_class. Use like: |
Function | method_decorator |
Convert a function decorator into a method decorator |
Function | sync_and_async_middleware |
Mark a middleware factory as returning a hybrid middleware supporting both types of request. |
Function | sync_only_middleware |
Mark a middleware factory as returning a sync middleware. This is the default. |
Class | classonlymethod |
Undocumented |
Function | _multi_decorate |
Decorate method with one or more function decorators. decorators can be a single decorator or an iterable of decorators. |
Function | _update_method_wrapper |
Undocumented |
Function | make_middleware_decorator |
Undocumented |
Like decorator_from_middleware, but return a function that accepts the arguments to be passed to the middleware_class. Use like:
cache_page = decorator_from_middleware_with_args(CacheMiddleware) # ... @cache_page(3600) def my_view(request): # ...
method
with one or more function decorators. decorators
can be
a single decorator or an iterable of decorators.