我们的django项目结构是这样的:
project
project
apps (folder with django apps)
consumer
provider
notifications
tasks.py (celery tasks)
locale
static
site (urls and settings files, we have different settings for, site, widget, api)
api
web
widget
provider (this one is going to use celery)
settings
dev.py
settings.py
urls
urls.py
__init__.py
manage.py
我尝试将celery.py放在site / provider文件夹中,但是我在运行celery worker时遇到了问题。我不确定从哪个文件夹运行worker。
Celery必须使用提供商设置并在apps文件夹中搜索任务。