From 0200fc14a38be5d0bac9e5fe9484d585ffa76921 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sat, 30 Nov 2013 13:38:57 +0100 Subject: Provide a solution to prevent monkey-patching the settings. This is necessary to work around extreme cases of circular imports. We really need to reverse URLs at import time and this isn't always possible. --- docs/installation.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'docs/installation.rst') diff --git a/docs/installation.rst b/docs/installation.rst index 221d85f..921cfe8 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -51,9 +51,21 @@ what it does, or if you prefer defining your settings explicitly, read below. during the start-up sequence. This works with ``manage.py runserver`` because it validates models before serving requests. +.. warning:: + + The automatic setup imports your project's URLconf in order to add the + Debug Toolbar's URLs. This may trigger circular imports when the URLconf + imports views that import models. If you're hitting an :exc:`ImportError`, + follow the explicit setup instructions. + Explicit setup -------------- +First, tell the toolbar not to adjust your settings automatically by adding +this line in your settings module:: + + DEBUG_TOOLBAR_PATCH_SETTINGS = False + URLconf ~~~~~~~ -- cgit v1.2.3