Kaydet (Commit) b8fc167b authored tarafından Claude Paroz's avatar Claude Paroz

Fixed #22688 -- Documented ready() may be called more than once

üst 63fc91b3
......@@ -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+)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment