I\'ve define a Celery app in a module, and now I want to start the worker from the same module in its __main__, i.e. by running the module with
The worker_main results now:
AttributeError: 'Celery' object has no attribute 'worker_main'
app = celery.Celery(
'project',
include=['project.tasks']
)
if __name__ == '__main__':
worker = app.Worker(
include=['project.tasks']
)
worker.start()
See here celery.apps.worker and celery.worker.WorkController.setup_defaults for details (hope it will be documented better in the future).