March 2020
Intermediate to advanced
608 pages
17h 17m
English
When you run an HTTP server or invoke a management command, django.setup() is called. It loads the settings, sets up logging, and prepares the app registry. This registry is initialized in three steps. Django first imports the configurations for each item from INSTALLED_APPS in the settings. These items can point to app names or configurations directly—for example, "myproject.apps.magazine" or "myproject.apps.magazine.apps.MagazineAppConfig".
Django then tries to import models.py from each app in INSTALLED_APPS and collect all of the models.
Finally, Django runs the ready() method for each app configuration. This method presents a good point in the development process to register signal handlers, if you have any. The ready() ...