Celery Received unregistered task of type (run example)

后端 未结 30 1860
旧时难觅i
旧时难觅i 2020-11-28 04:42

I\'m trying to run example from Celery documentation.

I run: celeryd --loglevel=INFO

/usr/local/lib/python2.7/dist-packages/celery/loade         


        
30条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 05:14

    I had this problem mysteriously crop up when I added some signal handling to my django app. In doing so I converted the app to use an AppConfig, meaning that instead of simply reading as 'booking' in INSTALLED_APPS, it read 'booking.app.BookingConfig'.

    Celery doesn't understand what that means, so I added, INSTALLED_APPS_WITH_APPCONFIGS = ('booking',) to my django settings, and modified my celery.py from

    app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
    

    to

    app.autodiscover_tasks(
        lambda: settings.INSTALLED_APPS + settings.INSTALLED_APPS_WITH_APPCONFIGS
    )
    

提交回复
热议问题