app/django/views/decorators/gzip.py
author Sverre Rabbelier <srabbelier@gmail.com>
Sun, 16 Nov 2008 23:03:37 +0000
changeset 494 5e9c656a1b68
parent 54 03e267d67478
permissions -rw-r--r--
Refactored SiteMap to be generic With this mechanism (in combination with the new sidebar) in place adding a new entity to the site becomes very easy, rather than having to add a lot of code to 'map.py', one can simply register with the sitemap modules.

"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)