app/django/views/decorators/gzip.py
author Sverre Rabbelier <srabbelier@gmail.com>
Mon, 09 Mar 2009 00:00:41 +0000
changeset 1762 c47b9deb22ac
parent 54 03e267d67478
permissions -rw-r--r--
Use getFromKeyFieldsOr404 in slots() and allocateSlots() Handling of the exception is done by the view decorator. Patch by: Sverre Rabbelier

"Decorator for views that gzips pages if the client supports it."

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

gzip_page = decorator_from_middleware(GZipMiddleware)