Snippet List
This snippet *updates* 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.
- text
- model
- field
- compressed
- gzip
- south
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.
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.
- files
- gzip
- streaming
- gzipmiddleware
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.
- text
- model
- field
- compressed
- gzip
Rather than using the full GZipMiddleware, you may want to just compress some views. This decorator lets you do that.
@gzip_compress
def your_view(request, ...):
....
- middleware
- decorator
- gzip
5 snippets posted so far.