test_template_to_temp_file tries to clean up after itself.
test_wkhtmltopdf tests that wkhtmltopdf generates a PDF.
wkhtmltopdf() uses subprocess.check_output() instead of a custom Popen call.
Reliable command-line argument parsing for wkhtmltopdf().

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.
settings.WKHTMLTOPDF_CMD is loaded on-the-fly, not at the module level.

This allows overriding this configuration option at run-time.
settings.WKHTMLTOPDF_CMD_OPTIONS sets default command-line options.
Use warnings.warn instead of raising PendingDeprecationWarnings.
Remove extraneous StringIO import.
PDFResponse is more robust:

* Now matches HttpResponse in function signature.
* Modern Django content_type/mimetype handling.
* Sanitizes and quotes filenames in Content-Disposition header.
* Tests.
PDFTemplateResponse and PDFTemplateView now match Django's implementations

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.
Move testproject to wkhtmltopdf._testproject.

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
PDFTemplateView.cmd_options contains all the options to pass to wkhtmltopdf

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.
PDFTemplateView actually renders headers and footers now.
Cleanups and documentation.
MEDIA_URL and STATIC_URL overrides PDFTemplateResponse.get_override_settings()

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.
settings.WKHTMLTOPDF_ENV can override environment variables.

This is most usefully set to {'DISPLAY': ':1'} in production. This
allows wkhtmltopdf access to a specific X headless server, since the
server will not be running under X.
PDFTemplateResponse.convert_to_pdf() calls wkhtmltopdf.

Method to make it easier to override spawning of the wkhtmltopdf subprocess.
settings.WKHTMLTOPDF_DEBUG defaults to settings.DEBUG.
docs/conf.py can now find the version number.
Documentation updates for new and updated behaviour.