Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Remove kwarg `current_app=None`. It does not appear to do anything and ↵ | Brian Buck | 2016-08-10 | 1 | -1/+0 |
| | | | | breaks on Django 1.10 | ||||
* | Remove dependency on Django template engine | Ryan Kaskel | 2016-02-17 | 1 | -0/+1 |
| | |||||
* | Extracted logic from views - fixed tests. | Jonathan Liuti | 2015-12-01 | 1 | -83/+9 |
| | | | | | | | | | | | The logic was coupled with the views which made things difficult to reuse if you wanted to use the pdf generation somehwere else than in a view. With this patch, the logic has been moved to `utils.py` and should be more easy to reuse. Tests have been adapted and made compatible with django > 1.7 | ||||
* | Rely only smart_text once django 1.4 also supports it. | Michel Sabchuk | 2014-09-01 | 1 | -5/+1 |
| | | | | | As well pointed by @mattack108, django 1.4 also haves smart_text. We don't have to do that import. | ||||
* | Being more explicit about the reason for smart_unicode. | Michel Sabchuk | 2014-09-01 | 1 | -0/+1 |
| | |||||
* | Replace smart_str with smart_text/unicode for py2.x compat. | Michel Sabchuk | 2014-09-01 | 1 | -2/+5 |
| | |||||
* | Removed mimetype from response for Django 1.7 compatibility. See ↵ | Paolo Melchiorre | 2014-07-02 | 1 | -4/+2 |
| | | | | https://docs.djangoproject.com/en/dev/internals/deprecation/#deprecation-removed-in-1-7 | ||||
* | Bring back the test assert for title in content | Matt Lenc | 2014-06-19 | 1 | -1/+2 |
| | |||||
* | First try py3k then fall back to python2 | Matt Lenc | 2014-06-18 | 1 | -3/+3 |
| | |||||
* | Add support for Python3 | Matt Lenc | 2014-06-18 | 1 | -6/+11 |
| | |||||
* | Move make_absolute_paths to utils so it can be used in tests | mattack108 | 2013-01-15 | 1 | -37/+4 |
| | |||||
* | Remove old unused arg from PDFTemplateResponse class | mattack108 | 2013-01-15 | 1 | -2/+1 |
| | |||||
* | Remove double quotes from filename as it's done by content_disposition_filename | mattack108 | 2013-01-15 | 1 | -3/+2 |
| | |||||
* | Send good headers, in correct format | mattack108 | 2013-01-15 | 1 | -2/+3 |
| | |||||
* | PEP8 all the things! | mattack108 | 2013-01-15 | 1 | -12/+10 |
| | |||||
* | Add support for rendering PDF file in the browser | mattack108 | 2013-01-15 | 1 | -7/+16 |
| | |||||
* | Remove duplicates when replacing file paths | Zach Gohr | 2013-01-09 | 1 | -2/+7 |
| | |||||
* | Tidy up a bit | mlen108 | 2012-11-14 | 1 | -5/+9 |
| | |||||
* | Fix paths for STATIC media files | mlen108 | 2012-11-14 | 1 | -10/+27 |
| | |||||
* | Match single/double quotes. | mlen108 | 2012-11-13 | 1 | -1/+1 |
| | |||||
* | Use MEDIA_URL instead of hard-coded string. | mlen108 | 2012-11-13 | 1 | -1/+1 |
| | |||||
* | Fix images path in PDFs | mlen108 | 2012-11-13 | 1 | -40/+16 |
| | |||||
* | Merge with incuna | Simon Law | 2012-08-23 | 1 | -42/+3 |
|\ | |||||
| * | .html default suffix for render_to_temporary_file | Marc Tamlyn | 2012-07-27 | 1 | -1/+1 |
| | | | | | | | | | | It's expected by wkhtmltopdf that the files should end in .html, so it may as well be the default. | ||||
| * | Don't override builtins by importing. | Marc Tamlyn | 2012-07-27 | 1 | -2/+2 |
| | | |||||
| * | Remove deprecated methods/views. | Marc Tamlyn | 2012-07-27 | 1 | -39/+0 |
| | | |||||
* | | Fix encoding issues ini PDFTemplateResponse.render_to_temporary_file() | Simon Law | 2012-08-23 | 1 | -1/+2 |
|/ | |||||
* | settings.WKHTMLTOPDF_DEBUG defaults to settings.DEBUG. | Simon Law | 2012-07-25 | 1 | -1/+1 |
| | |||||
* | PDFTemplateResponse.convert_to_pdf() calls wkhtmltopdf. | Simon Law | 2012-07-25 | 1 | -5/+18 |
| | | | | Method to make it easier to override spawning of the wkhtmltopdf subprocess. | ||||
* | MEDIA_URL and STATIC_URL overrides PDFTemplateResponse.get_override_settings() | Simon Law | 2012-07-25 | 1 | -17/+46 |
| | | | | | | | | | | | | | | | | MEDIA_URL and STATIC_URL used to be set only in get_context_data(), but there are apps such as staticfiles and Django Compressor where this won't work well. Instead, they need to be overridden at the settings level, not at the context level. This allows template context processors to populate a RequestContext with the right values. In addition, MEDIA_URL and STATIC_URL are now overridden as file:// URLs, based on MEDIA_ROOT and STATIC_ROOT. This allows developers to access these views in runserver, against their current codebase. It also means faster access for wkhtmltopdf, since the files are stored locally. | ||||
* | Cleanups and documentation. | Simon Law | 2012-07-24 | 1 | -3/+10 |
| | |||||
* | PDFTemplateView actually renders headers and footers now. | Simon Law | 2012-07-24 | 1 | -1/+4 |
| | |||||
* | PDFTemplateView.cmd_options contains all the options to pass to wkhtmltopdf | Simon Law | 2012-07-24 | 1 | -15/+45 |
| | | | | | | | | | | | | | | | | | | | | Before, command-line arguments were class-based. Unfortunately, this means that you cannot add new command-line arguments without subclassing. Instead, PDFTemplateView.cmd_options is a dictionary of all command-line arguments. PDFTemplateView.as_view(cmd_options={...}) now works as expected. !!!! WARNING !!!! cmd_options is now empty, leaving wkhtmltopdf with its default behaviour. Explicitly add the options you want. Existing subclasses of PDFTemplateView will now break, but a PendingDeprecationWarning will be issued. Margins will now be wkhtmltopdf's default of 10mm. PdfTemplateView contains a compatibility shim with the old default values for margins and orientation. | ||||
* | PDFTemplateResponse and PDFTemplateView now match Django's implementations | Simon Law | 2012-07-24 | 1 | -35/+139 |
| | | | | | | | | | PDFTemplateResponse is like TemplateResponse in that it does dynamic rendering of a template on the fly. PDFTemplateView has a much smaller implementation, relying on PDFTemplateResponse to do the rendering for it. It also knows about the standard TemplateResponse when it needs to render the HTML version. | ||||
* | PDFResponse is more robust: | Simon Law | 2012-07-23 | 1 | -5/+11 |
| | | | | | | | * Now matches HttpResponse in function signature. * Modern Django content_type/mimetype handling. * Sanitizes and quotes filenames in Content-Disposition header. * Tests. | ||||
* | Use warnings.warn instead of raising PendingDeprecationWarnings. | Simon Law | 2012-07-20 | 1 | -6/+7 |
| | |||||
* | Pass around args and kwargs in PDFResponse | George Hickman | 2012-05-21 | 1 | -5/+6 |
| | | | | | In case you want to pass more things up to HttpResponse. Can't pass filename down though. | ||||
* | Only set 'Content-Disposition' header if filename is set | George Hickman | 2012-05-21 | 1 | -2/+4 |
| | | | | | | | Setting 'Content-Disposition' explicitly sets the PDF as an attachment causing browsers to download the PDF. However newer browsers, like Chrome, will display the PDF without this header. So assume the dev wants this to be force download if they set the filename. | ||||
* | Don't remove tmp files before they're used. | George Hickman | 2012-05-21 | 1 | -6/+12 |
| | | | | | Put _tmp_files onto the object and remove them after the output has been created. | ||||
* | Fixed remote images in pdf | James Turnbull | 2012-03-09 | 1 | -2/+6 |
| | | | | If there's no context_instance (which seems to be the common case), make a Requestcontext and use that. | ||||
* | Use get_template_names() to get templates | James Turnbull | 2012-03-09 | 1 | -1/+1 |
| | | | | | Rather than directly going to self.template_name use the get_template_names() function (which returns self.template_name if not overridden). | ||||
* | Restore *args to PDFTemplateView. | Charlie Denton | 2012-02-24 | 1 | -4/+2 |
| | |||||
* | Fix a couple of daft mistakes. | Charlie Denton | 2012-02-24 | 1 | -6/+7 |
| | |||||
* | Add get_filename method. | Charlie Denton | 2012-02-23 | 1 | -1/+4 |
| | |||||
* | Made PDFTemplateView a little more extensible, and added orientation. | Charlie Denton | 2012-02-23 | 1 | -12/+18 |
| | |||||
* | Return super when called. | Charlie Denton | 2012-02-23 | 1 | -1/+1 |
| | |||||
* | Make PDFTemplateView use PDFResponse. | Charlie Denton | 2012-02-23 | 1 | -1/+1 |
| | |||||
* | Deprecate baDly cApitalised Views. | Charlie Denton | 2012-02-23 | 1 | -2/+16 |
| | |||||
* | Fix use of STATIC vs MEDIA url | George Hickman | 2011-10-30 | 1 | -1/+1 |
| | |||||
* | Refactor the main render method into a class based view | George Hickman | 2011-10-30 | 1 | -0/+61 |
Use a PdfResponse to deal with the headers and response type. Make the margin_* and filename variables instance variables on the view with sane defaults. |