diff options
| author | anatoly techtonik <techtonik@gmail.com> | 2012-05-03 21:52:56 +0300 |
|---|---|---|
| committer | anatoly techtonik <techtonik@gmail.com> | 2012-05-16 16:13:39 +0300 |
| commit | 59d2b8aa16126d8d0a453f07d5c3497048bcd6b0 (patch) | |
| tree | 90a9c66cec00d0c3caff7fdec9b8abbda8618870 /docs | |
| parent | 00c0d3c44ebc4e3461653ec96cd47023cc0a6e5b (diff) | |
Fix issue #18267 - document `settings.configured` property.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/topics/settings.txt | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/docs/topics/settings.txt b/docs/topics/settings.txt index 52cc06da56..88fa7b6864 100644 --- a/docs/topics/settings.txt +++ b/docs/topics/settings.txt @@ -220,7 +220,7 @@ In this example, default settings are taken from ``myapp_defaults``, and the The following example, which uses ``myapp_defaults`` as a positional argument, is equivalent:: - settings.configure(myapp_defaults, DEBUG = True) + settings.configure(myapp_defaults, DEBUG=True) Normally, you will not need to override the defaults in this fashion. The Django defaults are sufficiently tame that you can safely use them. Be aware @@ -242,7 +242,16 @@ is accessed. If you set ``DJANGO_SETTINGS_MODULE``, access settings values somehow, *then* call ``configure()``, Django will raise a ``RuntimeError`` indicating -that settings have already been configured. +that settings have already been configured. There is a property just for this +purpose: + +.. attribute: django.conf.settings.configured + +For example:: + + from django.conf import settings + if not settings.configured: + settings.configure(myapp_defaults, DEBUG=True) Also, it's an error to call ``configure()`` more than once, or to call ``configure()`` after any setting has been accessed. |
