mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Renamed AppConfig.setup to ready.
Thanks Jannis and Marc for the feedback. Fixed #21717.
This commit is contained in:
parent
63137a8304
commit
1d23d766ab
6 changed files with 11 additions and 11 deletions
|
@ -175,10 +175,10 @@ Methods
|
|||
``model_name``. Raises :exc:`~exceptions.LookupError` if no such model
|
||||
exists. ``model_name`` is case-insensitive.
|
||||
|
||||
.. method:: AppConfig.setup()
|
||||
.. method:: AppConfig.ready()
|
||||
|
||||
Subclasses can override this method to perform setup tasks such as
|
||||
registering signals. It is called as soon as the registry is fully
|
||||
Subclasses can override this method to perform initialization tasks such
|
||||
as registering signals. It is called as soon as the registry is fully
|
||||
populated.
|
||||
|
||||
Application registry
|
||||
|
|
|
@ -355,7 +355,7 @@ been defined and registered with Django's model system. Django uses this
|
|||
signal internally; it's not generally used in third-party applications.
|
||||
|
||||
Since this signal is sent during the app registry population process, and
|
||||
:meth:`AppConfig.setup() <django.apps.AppConfig.setup>` runs after the app
|
||||
:meth:`AppConfig.ready() <django.apps.AppConfig.ready>` runs after the app
|
||||
registry is fully populated, receivers cannot be connected in that method.
|
||||
One possibility is to connect them ``AppConfig.__init__()`` instead, taking
|
||||
care not to import models or trigger calls to the app registry.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue