From patchwork Tue Mar 15 10:55:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 597454 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qPWkQ3YmHz9s48 for ; Tue, 15 Mar 2016 21:55:58 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3qPWkQ2FlZzDqyJ for ; Tue, 15 Mar 2016 21:55:58 +1100 (AEDT) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lists.ozlabs.org (Postfix) with ESMTP id 3qPWkK5Fk5zDqgl for ; Tue, 15 Mar 2016 21:55:53 +1100 (AEDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 15 Mar 2016 03:55:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,338,1455004800"; d="scan'208";a="764449744" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga003.jf.intel.com with ESMTP; 15 Mar 2016 03:55:35 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u2FAtYDH005572; Tue, 15 Mar 2016 10:55:35 GMT Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id u2FAtYCF010784; Tue, 15 Mar 2016 10:55:34 GMT Received: (from sfinucan@localhost) by sivswdev01.ir.intel.com with id u2FAtY2Y010779; Tue, 15 Mar 2016 10:55:34 GMT From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH] Add support for 'django-debug-toolbar' Date: Tue, 15 Mar 2016 10:55:32 +0000 Message-Id: <1458039332-10737-1-git-send-email-stephen.finucane@intel.com> X-Mailer: git-send-email 2.0.0 X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" 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 --- docs/development.md | 7 +++++++ patchwork/settings/dev.py | 7 +++++++ requirements-dev.txt | 1 + 3 files changed, 15 insertions(+) diff --git a/docs/development.md b/docs/development.md index d69f42f..1ed317d 100644 --- a/docs/development.md +++ b/docs/development.md @@ -231,6 +231,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-dev.txt b/requirements-dev.txt index d52ce6f..5a62e44 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,2 +1,3 @@ Django<1.9,>=1.8 +django-debug-toolbar==1.4 -r requirements-test.txt