summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2014-07-12 15:33:21 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2014-07-12 18:49:37 +0200
commita764a9ccff6e2a2cf048e658dd824bf302c74df7 (patch)
tree3cc46c4f9f9dac7f5202c3e1839132a0c7a9699d /docs/ref
parentb48c2c59253b2f2bedea40ed890f0be6ccad9f46 (diff)
Checked more precisely whether the app registry is ready.
Accounted for the three stages of population: app configs, models, ready() methods of app configs.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/applications.txt10
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/ref/applications.txt b/docs/ref/applications.txt
index a7590b899d..f1da87a1fd 100644
--- a/docs/ref/applications.txt
+++ b/docs/ref/applications.txt
@@ -301,10 +301,6 @@ Application registry
Checks whether an application with the given name exists in the registry.
``app_name`` is the full name of the app, e.g. ``'django.contrib.admin'``.
- Unlike :meth:`~django.apps.apps.get_app_config`, this method can be called
- safely at import time. If the registry is still being populated, it may
- return ``False``, even though the app will become available later.
-
.. method:: apps.get_model(app_label, model_name)
Returns the :class:`~django.db.models.Model` with the given ``app_label``
@@ -365,6 +361,9 @@ processes all applications in the order of :setting:`INSTALLED_APPS`.
the order of :setting:`INSTALLED_APPS`, it's strongly recommended not
import any models at this stage.
+ Once this stage completes, APIs that operate of application configurations
+ such as :meth:`~apps.get_app_config()` become usable.
+
#. Then Django attempts to import the ``models`` submodule of each application,
if there is one.
@@ -372,6 +371,9 @@ processes all applications in the order of :setting:`INSTALLED_APPS`.
``models/__init__.py``. Otherwise, the application registry may not be fully
populated at this point, which could cause the ORM to malfunction.
+ Once this stage completes, APIs that operate on models such as
+ :meth:`~apps.get_model()` become usable.
+
#. Finally Django runs the :meth:`~AppConfig.ready()` method of each application
configuration.