defining a custom post_migrate signal

一个人想着一个人 提交于 2019-11-29 02:06:41

The Django docs recommend connecting the post_migrate signal in your app config's ready method. The Google groups post you link to is out of date, from before the docs were updated.

You also need to specify the app config in your INSTALLED_APPS setting.

INSTALLED_APPS = [
    'myapp.apps.MyAppConfig',
    # ...
]

Another way to configure your app is to use default_app_config in __init__.py of your app. See Configuring Applications. But the other way (dotted path to AppConfig) is preferred.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!