Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix issue #18267 - document `settings.configured` property.

  • Loading branch information...
commit 59d2b8aa16126d8d0a453f07d5c3497048bcd6b0 1 parent 00c0d3c
anatoly techtonik authored May 03, 2012

Showing 1 changed file with 11 additions and 2 deletions. Show diff stats Hide diff stats

  1. 13  docs/topics/settings.txt
13  docs/topics/settings.txt
@@ -220,7 +220,7 @@ In this example, default settings are taken from ``myapp_defaults``, and the
220 220
 The following example, which uses ``myapp_defaults`` as a positional argument,
221 221
 is equivalent::
222 222
 
223  
-    settings.configure(myapp_defaults, DEBUG = True)
  223
+    settings.configure(myapp_defaults, DEBUG=True)
224 224
 
225 225
 Normally, you will not need to override the defaults in this fashion. The
226 226
 Django defaults are sufficiently tame that you can safely use them. Be aware
@@ -242,7 +242,16 @@ is accessed.
242 242
 
243 243
 If you set ``DJANGO_SETTINGS_MODULE``, access settings values somehow, *then*
244 244
 call ``configure()``, Django will raise a ``RuntimeError`` indicating
245  
-that settings have already been configured.
  245
+that settings have already been configured. There is a property just for this
  246
+purpose:
  247
+
  248
+.. attribute: django.conf.settings.configured
  249
+
  250
+For example::
  251
+
  252
+    from django.conf import settings
  253
+    if not settings.configured:
  254
+        settings.configure(myapp_defaults, DEBUG=True)
246 255
 
247 256
 Also, it's an error to call ``configure()`` more than once, or to call
248 257
 ``configure()`` after any setting has been accessed.

0 notes on commit 59d2b8a

Please sign in to comment.
Something went wrong with that request. Please try again.