diff options
-rw-r--r-- | docs/index.rst | 6 | ||||
-rw-r--r-- | wkhtmltopdf/tests/run.py | 12 |
2 files changed, 15 insertions, 3 deletions
diff --git a/docs/index.rst b/docs/index.rst index 817db3f..67442a8 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,7 +6,7 @@ django-wkhtmltopdf the wkhtmltopdf_ library, allowing you to write using the technologies you know - HTML and CSS - and output a PDF file. -.. _wkhtmltopdf: http://code.google.com/p/wkhtmltopdf/ +.. _wkhtmltopdf: http://wkhtmltopdf.org/ Quickstart ========== @@ -17,7 +17,7 @@ Quickstart Grab the wkhtmltopdf binary_ for your platform. -.. _binary: http://code.google.com/p/wkhtmltopdf/downloads/list +.. _binary: http://wkhtmltopdf.org/downloads.html ``settings.py`` @@ -46,7 +46,7 @@ Contribute You can fork the project on Github_. -.. _Github: http://github.com/incuna/django-wkhtmltopdf +.. _Github: https://github.com/incuna/django-wkhtmltopdf Contents ======== diff --git a/wkhtmltopdf/tests/run.py b/wkhtmltopdf/tests/run.py index a840e68..5004ee1 100644 --- a/wkhtmltopdf/tests/run.py +++ b/wkhtmltopdf/tests/run.py @@ -2,10 +2,12 @@ import os import sys +import django from django.conf import settings DIRNAME = os.path.abspath(os.path.dirname(__file__)) +sys.path.insert(0, os.getcwd()) settings.configure( DEBUG=True, @@ -19,6 +21,10 @@ settings.configure( 'wkhtmltopdf.tests', 'wkhtmltopdf', ), + MIDDLEWARE_CLASSES=( + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + ), MEDIA_ROOT=os.path.join(DIRNAME, 'media'), MEDIA_URL='/media/', STATIC_ROOT=os.path.join(DIRNAME, 'static'), @@ -27,6 +33,12 @@ settings.configure( ) try: + django.setup() +except AttributeError: + pass # Django < 1.7; okay to ignore + + +try: from django.test.runner import DiscoverRunner except ImportError: from discover_runner.runner import DiscoverRunner |