mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Deprecated importing a model before loading its application.
Refs #21719, #21680.
This commit is contained in:
parent
81bb8d1220
commit
3326a412cc
5 changed files with 40 additions and 5 deletions
|
@ -181,6 +181,13 @@ Methods
|
|||
as registering signals. It is called as soon as the registry is fully
|
||||
populated.
|
||||
|
||||
You cannot import models in modules that define application configuration
|
||||
classes, but you can use :meth:`get_model` to access a model class by
|
||||
name, like this::
|
||||
|
||||
def ready(self):
|
||||
MyModel = self.get_model('MyModel')
|
||||
|
||||
Application registry
|
||||
====================
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue