| 1 |
"""Decorators to apply Apache X-Sendfile on a specific view.""" |
| 2 |
|
| 3 |
from django_downloadview.apache.middlewares import XSendfileMiddleware |
| 4 |
from django_downloadview.decorators import DownloadDecorator |
| 5 |
|
| 6 |
|
| 7 |
def x_sendfile(view_func, *args, **kwargs): |
| 8 |
"""Apply |
| 9 |
:class:`~django_downloadview.apache.middlewares.XSendfileMiddleware` to |
| 10 |
``view_func``. |
| 11 |
|
| 12 |
Proxies (``*args``, ``**kwargs``) to middleware constructor. |
| 13 |
|
| 14 |
""" |
| 15 |
decorator = DownloadDecorator(XSendfileMiddleware) |
| 16 |
return decorator(view_func, *args, **kwargs) |