| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoid polluting the global library namespace with
testproject. Instead, since wkhtmltopdf tests use it, we install it
within under a "private" name.
--HG--
rename : testproject/__init__.py => wkhtmltopdf/_testproject/__init__.py
rename : testproject/manage.py => wkhtmltopdf/_testproject/manage.py
rename : testproject/requirements.txt => wkhtmltopdf/_testproject/requirements.txt
rename : testproject/settings.py => wkhtmltopdf/_testproject/settings.py
rename : testproject/templates/footer.html => wkhtmltopdf/_testproject/templates/footer.html
rename : testproject/templates/sample.html => wkhtmltopdf/_testproject/templates/sample.html
rename : testproject/urls.py => wkhtmltopdf/_testproject/urls.py
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
* Now matches HttpResponse in function signature.
* Modern Django content_type/mimetype handling.
* Sanitizes and quotes filenames in Content-Disposition header.
* Tests.
|
| |
|
| |
|
| |
|
|
|
|
| |
This allows overriding this configuration option at run-time.
|
|
|
|
|
|
| |
The API for wkhtmltopdf has changed. Long arguments that take no
parameters now use True and not the empty string. In addition,
argument-parameters may now be Unicode.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
* Tidy up the setup.py.
* Remove the old `fread` method.
* Make `__version__` a string.
* Move `__author__` into __init__.py
|
|
|
|
|
| |
In case you want to pass more things up to HttpResponse.
Can't pass filename down though.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Put _tmp_files onto the object and remove them after the output has been
created.
|
| |
|
|
|
|
| |
If there's no context_instance (which seems to be the common case), make a Requestcontext and use that.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
It's not obvious what template_to_temp_file is doing with its undefined arguments.
The Zen of Python states:
Explicit is better than implicit.
Readability counts.
An alternative solution would be to rename the function to loader_render_to_tempfile or similar,
but this fix is more backwards-compatible.
|
|
|
|
|
| |
Rather than directly going to self.template_name use the get_template_names() function
(which returns self.template_name if not overridden).
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Fix a spelling mistake
Wrap a particularly long line
|
|
|
|
|
| |
Replace old style file open and close with a `with` block for clarity
and it's error handling.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|