pip
install
apscheduler==2.1.2
安装完成后,打开django web 项目的views.py 增加以下内容:
from
apscheduler.scheduler
import
Scheduler
sched = Scheduler()
@sched.interval_schedule(seconds=60)
def delStatic_rollingRegression():
for file in os.listdir('./'):
path_file = os.path.join('./', file)
if os.path.isfile(path_file):
os.remove(path_file)
sched.start()