目录
安装 django-crontab
$ pip install django-crontab
配置settings文件
# 需要在APP之前
INSTALLED_APPS = [
....
'django_crontab',
'apps',
]
定义函数
# app/cron.py
def do_something():
print('hello')
settings文件中配置定时函数
#. 添加定时任务(函数中的输出语句,是输出在.log文件中的)CRONJOBS = (
('00 00 * * *