芹菜文檔說配置文件應該在工作目錄或python路徑中。芹菜配置文件位置
from celery import Celery
from properties import config_file
import sys
sys.path.append(config_file)
app = Celery()
app.config_from_object(config_file.split('.')[0])
這裏的config_file是/opt/celery/celery_config.py
。這個想法是給用戶創建配置文件的自由。該文檔說配置文件應該在工作目錄或sys路徑中。我在sys路徑中添加了config_file,但是當worker啓動時,它會拋出導入錯誤。
是否需要將config_file與創建Celery實例的模塊放在同一目錄中?
你可以給性能模塊的代碼嗎? –