2013-11-26 08:30:19 +00:00
|
|
|
"""Decorators to apply Apache X-Sendfile on a specific view."""
|
2024-08-05 08:51:17 +00:00
|
|
|
|
2013-11-26 08:30:19 +00:00
|
|
|
from django_downloadview.apache.middlewares import XSendfileMiddleware
|
2020-01-07 14:18:54 +00:00
|
|
|
from django_downloadview.decorators import DownloadDecorator
|
2013-11-26 08:30:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def x_sendfile(view_func, *args, **kwargs):
|
|
|
|
|
"""Apply
|
|
|
|
|
:class:`~django_downloadview.apache.middlewares.XSendfileMiddleware` to
|
|
|
|
|
``view_func``.
|
|
|
|
|
|
|
|
|
|
Proxies (``*args``, ``**kwargs``) to middleware constructor.
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
decorator = DownloadDecorator(XSendfileMiddleware)
|
|
|
|
|
return decorator(view_func, *args, **kwargs)
|