summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2014-05-24 15:57:04 +0200
committerClaude Paroz <claude@2xlibre.net>2014-05-24 15:59:28 +0200
commitdbdbda87fc38816c45584ea7a97876078cbffb3a (patch)
tree0b1da773708cee1280a2794a848962c7fa7ca3bc
parenta59870e21784166725f7cb3230becef50553ee3a (diff)
[1.7.x] Fixed #22688 -- Documented ready() may be called more than once
Backport of b8fc167b32 from master.
-rw-r--r--docs/ref/applications.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/ref/applications.txt b/docs/ref/applications.txt
index 72b33230ba..8052524a49 100644
--- a/docs/ref/applications.txt
+++ b/docs/ref/applications.txt
@@ -238,6 +238,15 @@ Methods
separate from the production settings, ``manage.py test`` would still
execute some queries against your **production** database!
+ .. note::
+
+ In the usual initialization process, the ``ready`` method is only called
+ once by Django. But in some corner cases, particularly in tests which
+ are fiddling with installed applications, ``ready`` might be called more
+ than once. In that case, either write idempotents methods, or put a flag
+ on your ``AppConfig`` classes to prevent re-running code which should
+ be executed exactly one time.
+
.. _namespace package:
Namespace packages as apps (Python 3.3+)