django-zipfileA ZipFile subclass that accepts Django Templates | |
Download |
django-zipfile Ranking & Summary
Advertisement
- License:
- MIT/X Consortium Lic...
- Price:
- FREE
- Publisher Name:
- Flavio Curella
- Publisher web site:
- https://github.com/fcurella/
django-zipfile Tags
django-zipfile Description
django-zipfile is a subclass of zipfile.Zipfile that works with Django templates.Usage:from zipfile import ZIP_DEFLATEDfrom django_zipfile import TemplateZipFiledef myview(request, object_id): obj = get_object_or_404(MyModel, pk=object_id) context = { 'object': obj } response = HttpResponse(mimetype='application/octet-stream') response = '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 responseProduct's homepage
django-zipfile Related Software