MCPcopy
hub / github.com/django/django / ready

Method ready

django/contrib/auth/apps.py:18–35  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

16 verbose_name = _("Authentication and Authorization")
17
18 def ready(self):
19 post_migrate.connect(
20 rename_permissions_after_model_rename,
21 dispatch_uid="django.contrib.auth.management.rename_permissions",
22 )
23 post_migrate.connect(
24 create_permissions,
25 dispatch_uid="django.contrib.auth.management.create_permissions",
26 )
27 last_login_field = getattr(get_user_model(), "last_login", None)
28 # Register the handler only if UserModel.last_login is a field.
29 if isinstance(last_login_field, DeferredAttribute):
30 from .models import update_last_login
31
32 user_logged_in.connect(update_last_login, dispatch_uid="update_last_login")
33 checks.register(check_user_model, checks.Tags.models)
34 checks.register(check_models_permissions, checks.Tags.models)
35 checks.register(check_middleware)

Callers

nothing calls this directly

Calls 3

get_user_modelFunction · 0.85
connectMethod · 0.45
registerMethod · 0.45

Tested by

no test coverage detected