You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Initialization process
1.1 How applications are loaded
关键点:
When Django starts, django.setup() is responsible for populating the application registry.
2. Troubleshooting
解释了可能引发错误的场景
环境: 以下两种环境都会报出该错误:
1. Ubuntu16、Python2.7.12
2. Ubuntu16、Python3.5
其余模块版本按作者的进行安装。
报错信息:
终于找到了官方文档中关于报错问题:
https://docs.djangoproject.com/en/1.10/ref/applications/#app-loading-process
解决方法:参考官方文档
代码中如何解决:
改为:
且celery.py文件中
最终:
tasks.py文件中的任务,写到celery.py文件中,加上django.setup()即可
参考的讨论帖:
https://stackoverflow.com/questions/34114427/django-upgrading-to-1-9-error-appregistrynotready-apps-arent-loaded-yet(重要)
https://github.com/celery/celery/issues/3584(重要)
https://docs.djangoproject.com/en/1.10/ref/applications/#initialization-process
https://stackoverflow.com/questions/52557060/python3-exception-using-shared-task-with-queue-option
http://docs.celeryproject.org/en/latest/userguide/tasks.html
http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html
The text was updated successfully, but these errors were encountered: