aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Finucane <stephen.finucane@intel.com>2016-01-08 16:14:47 +0000
committerStephen Finucane <stephen.finucane@intel.com>2016-03-15 11:28:33 +0000
commitf7fd8dff74e8e7168fb5be7665c8d74bf8409564 (patch)
tree73109f17e6a4d6b109c7c0efc0a1cbec896c463d
parentaf4d348ede2698198ba34af466e136860570505b (diff)
downloadpatchwork-f7fd8dff74e8e7168fb5be7665c8d74bf8409564.tar
patchwork-f7fd8dff74e8e7168fb5be7665c8d74bf8409564.tar.gz
Add support for 'django-debug-toolbar'
This tool is exceptionally helpful for debugging issues with Django: install it as part of the 'dev' configuration. This only works on Django > 1.6, due to a lack of support for older versions in the upstream. A note is included to help users avoid the issues seen when running patchwork on a different machine. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
-rw-r--r--docs/development.md7
-rw-r--r--patchwork/settings/dev.py7
-rw-r--r--requirements-test.txt1
3 files changed, 15 insertions, 0 deletions
diff --git a/docs/development.md b/docs/development.md
index d48d048..ace9e59 100644
--- a/docs/development.md
+++ b/docs/development.md
@@ -229,6 +229,13 @@ environment:
Should you wish to re-enter this environment, simply source the `activate`
script again.
+## Django Debug Toolbar
+
+patchwork installs and enables the 'Django Debug Toolbar' by default. However,
+by default this is only displayed if you are developing on localhost. If
+developing on a different machine, you should configure an SSH tunnel such
+that, for example, `localhost:8000` points to `[DEV_MACHINE_IP]:8000`.
+
## Environment Variables
The following environment variables are available to configure settings when
diff --git a/patchwork/settings/dev.py b/patchwork/settings/dev.py
index 21aadb5..8e3fc69 100644
--- a/patchwork/settings/dev.py
+++ b/patchwork/settings/dev.py
@@ -18,6 +18,13 @@ from .base import * # noqa
# https://docs.djangoproject.com/en/1.6/ref/settings/#core-settings
#
+# Models
+
+if django.VERSION > (1, 6):
+ INSTALLED_APPS += [
+ 'debug_toolbar'
+ ]
+
# Security
SECRET_KEY = '00000000000000000000000000000000000000000000000000'
diff --git a/requirements-test.txt b/requirements-test.txt
index 29ecd66..92bc387 100644
--- a/requirements-test.txt
+++ b/requirements-test.txt
@@ -1,3 +1,4 @@
mysqlclient==1.3.7 # replace this with psycopg2 for a PostgreSQL backend
+django-debug-toolbar==1.4
python-dateutil==2.4.2
selenium==2.48.0