djangosnippets.org: Latest snippets tagged with 'gzip'http://djangosnippets.org/tags/gzip/2013-02-15T10:32:25.505165-06:00CompressedTextField for Django 1.4+
2013-02-15T10:32:25.505165-06:00devhuluhttp://djangosnippets.org/snippets/2893/<p>This snippet <em>updates</em> http://www.djangosnippets.org/snippets/383/ and http://www.djangosnippets.org/snippets/1495/ for Django 1.4+, and adds support for sqlite3 and south. Original snippet text: A CompressedTextField to transparently save data gzipped in the database and uncompress at retrieval.</p>
Freely redistributableFix 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 redistributableGzipFileSystemStorage
2009-09-29T15:16:21.674273-05:00dcwatsonhttp://djangosnippets.org/snippets/1747/<p><code>GzipFileSystemStorage</code> is a <code>FileSystemStorage</code> subclass that transparently compresses files.</p>
<p><a href="http://theidioteque.net/blog/2009/9/29/gzipfilesystemstorage/">More Info</a></p>
Freely redistributableCompressedTextField for Django 1.0+
2009-05-07T09:31:32.373992-05:00bwhittingtonhttp://djangosnippets.org/snippets/1495/<p>This snippet updates http://www.djangosnippets.org/snippets/383/ for Django 1.0+, and adds support for sqlite3.
Original snippet text:
A CompressedTextField to transparently save data gzipped in the database and uncompress at retrieval.</p>
Freely redistributableGzip decorator
2008-07-24T18:20:26.315886-05:00SmileyChrishttp://djangosnippets.org/snippets/910/<p>Rather than using the full GZipMiddleware, you may want to just compress some views. This decorator lets you do that.</p>
<pre><code>@gzip_compress
def your_view(request, ...):
....
</code></pre>
Freely redistributable