app/django/views/decorators/gzip.py
author Sverre Rabbelier <srabbelier@gmail.com>
Fri, 30 Jan 2009 21:58:53 +0000 (2009-01-30)
changeset 1089 810d466514c9
parent 54 03e267d67478
permissions -rw-r--r--
Copy the default django patterns rather than modifying them This prevents an ever-growing list of urls in the case that getDjangoURLPatterns is called multiple times. 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)