diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-07-12 15:33:21 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-07-12 18:50:23 +0200 |
| commit | dda6759e0e7f4ff4e1a856c1d907cea619a1dfda (patch) | |
| tree | 965b12aa916bc9c0d33c3bb11aeeac8e61384ff8 /docs/ref/applications.txt | |
| parent | aa1c615428a9bb2e175076b1fc4b6b4a3955c55d (diff) | |
[1.7.x] Checked more precisely whether the app registry is ready.
Accounted for the three stages of population: app configs, models,
ready() methods of app configs.
Backport of a764a9cc from master
Diffstat (limited to 'docs/ref/applications.txt')
| -rw-r--r-- | docs/ref/applications.txt | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/ref/applications.txt b/docs/ref/applications.txt index f944a6fcac..6469b76630 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. |
