AppConfig / ready() (Django)
AppConfig is the class that configures a Django app, set in the app's apps.py. Its ready() method runs once at startup, making it the standard place to connect signal handlers and do app initialization.
Django
Each app has an apps.py defining an AppConfig subclass. It carries metadata like name (the import path) and verbose_name (the human label shown in the admin), and a default_auto_field that sets the primary-key type for the app's models.
The ready() method is its most useful feature: Django calls it exactly once when the app registry is fully loaded. Because importing signal handlers anywhere else risks running too early or twice, importing them inside ready() is the documented place to register signals.
You point INSTALLED_APPS at the config class ('blog.apps.BlogConfig') to make sure your custom AppConfig is used rather than the default one Django would otherwise generate.
Syntax
class BlogConfig(AppConfig):
def ready(self): ...Examples
Python
# blog/apps.py
from django.apps import AppConfig
class BlogConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "blog"
def ready(self):
from . import signals # register signal handlers