post_migrate documentation example is wrong
The example in the documentation https://docs.djangoproject.com/en/dev/ref/signals/#post-migrate does not work, it's probably copied from the old post_syncdb docs. One needs to pass the AppConfig instance, so the example should read:
from django.db.models.signals import post_migrate
from django.apps import apps
def my_callback(sender, **kwargs):
# Your specific logic here
pass
post_migrate.connect(my_callback, sender=apps.get_app_config('yourapp'))
Change History
(7)
Keywords: |
app-loading added
|
Severity: |
Normal → Release blocker
|
Triage Stage: |
Unreviewed → Accepted
|
Owner: |
changed from nobody to Tim Graham
|
Status: |
new → assigned
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
LGTM