djangosnippets.org: Latest snippets posted by wojtekhttp://djangosnippets.org/users/wojtek/2009-11-05T10:12:56.868745-06:00wojtekFix for GZipMiddleware when serving files or streaming or using iterators
2009-11-05T10:12:56.868745-06:00wojtekhttp://djangosnippets.org/snippets/1782/<p>A simple replacement for Django's default GZipMiddleware which breaks when trying to serve files or pass any kind of iterators to the HttpResponse object.</p>
<p>Simply replace GZipMiddleware with the provided middleware and set response.dontgzip = True when returning the response, and it will then be ignored by the middleware.</p>
Freely redistributable