A ZipFile subclass that accepts Django Templates
Project description
A subclass of zipfile.Zipfile that works with Django templates.
Usage:
from zipfile import ZIP_DEFLATED from django_zipfile import TemplateZipFile def myview(request, object_id): obj = get_object_or_404(MyModel, pk=object_id) context = { 'object': obj } response = HttpResponse(mimetype='application/octet-stream') response['Content-Disposition'] = 'attachment; filename=myfile.zip' container = TemplateZipFile(response, mode='w', compression=ZIP_DEFLATED, template_root='myapp/myzipskeleton/') container.add_template('mimetype') container.add_template('META-INF/container.xml') container.add_template('chapter1.html', context=context) container.close() return response
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-zipfile-0.0.6.tar.gz
(3.0 kB
view details)
File details
Details for the file django-zipfile-0.0.6.tar.gz
.
File metadata
- Download URL: django-zipfile-0.0.6.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9187f263e426c54e9f520a019f74e6d9f1e7c14d110e6a316019af3a596bcafe |
|
MD5 | af90918907145ec59edae6a441b19c07 |
|
BLAKE2b-256 | 98801ac078a5108f718b2839443ccdfe1e258b3aa4cdd3a29ef8c7b1a83eb6b4 |