2
我正在芹菜拍打任務和任務工作正常(在預定時間正常運行)但我無法看到任務在我的管理頁面和所有芹菜相關的表是空的在我的PostgreSQL數據庫(前django_celery_beat_periodictask)芹菜任務沒有在Django數據庫註冊
我在這裏失蹤?
要求
Django==1.9.7
python==3.5
celery==4.1.0
django-celery-beat==1.0.1
項目樹
advocate
|
drive
|
-- celery.py
-- tasks.py
celery.py
from __future__ import absolute_import, unicode_literals
from celery import Celery
from celery.schedules import crontab
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'advocate.settings')
# app = Celery('drive', broker='redis://localhost:6379/0')
app = Celery('drive', broker='redis://localhost:6379/0', include=['drive.tasks'])
app.control.purge()
app.config_from_object('django.conf:settings', namespace='CELERY')
# crontab for test
app.conf.beat_schedule = {
'Emails-Every-Mon_Wed_Fri': {
'task': 'drive.tasks.weekly_task',
'schedule': crontab(minute='*/5'),
},
}
app.conf.timezone = 'UTC'
# Optional configuration, see the application user guide.
app.conf.update(
result_expires=3600,
)
app.autodiscover_tasks()
if __name__ == '__main__':
app.start()
運行命令使用
芹菜-A驅動工人-B --loglevel =調試-S Django的