Задать вопрос

Тел: +7 965 3737 888

435

Просмотров

2

Ответов

Gzip decorator

<p>Rather than using the full GZipMiddleware, you may want to just compress some views. This decorator lets you do that.</p>
@gzip_compress
def your_view(request, ...):
    ....

Вопрос полезен? Да0/Нет0
file_3537.py(574.0б)
None

Ответы (2):

Ответluftyluft:24.07.2008
Ответ полезен? Да0/Нет0

sorry, that should have been django.utils.decorators

Ответluftyluft:24.07.2008
Ответ полезен? Да0/Нет0

Note that you can also use django.utils.decorator_from_middleware to achieve the same thing.

from django.utils import decorator_from_middleware
from django.middleware.gzip import GZipMiddleware

@decorator_from_middleware(GZipMiddleware)
def my_view(request):
    pass