celery 支撑 django-celery-beat启动服务,需安装俩包:
pip install celery pip
install django-celery-beat
记得同步表
python manage.py makemigrations
Python manage migrate
django setting.py 文件配置信息:
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework', # 接口
'rest_framework.authtoken',
'corsheaders', # 跨域设置
# 'djcelery', # celery 定时任务
'django_celery_beat',
# 'django_rundirect', # 脚本启动
'archives'