djangosnippets.org: Latest snippets tagged with 'streaming'https://djangosnippets.org/tags/streaming/2009-11-05T10:12:56.868745-06:00Fix for GZipMiddleware when serving files or streaming or using iterators
2009-11-05T10:12:56.868745-06:00wojtekhttps://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