django-celery 应用方法

*************settings
import djcelery
djcelery.setup_loader()
BROKER_URL='redis://:mima@1.1.11.1:6379/0'
#redis://密码@ip:6379/0
CELERY_RESULT_BACKEND='redis://:omima@1.1.11.1:6379/0'
CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TIMEZONE = 'Africa/Nairobi'
CELERY_IMPORTS=['app01.task']
#task路径
from datetime import timedelta
 
 
--------------celery.py 文件
############task.py
任务方法
 
------------------------template
 
 
 
 
------------view 视图函数
 
 
 
 
 
 
 
 
 
 
 
 
posted @ 2018-07-17 15:20  昂达达  阅读(152)  评论(1编辑  收藏  举报