I need to reload my flask application hosted on pythonAnywhere everyday. Is it possible to automatically reload the application using the code i already have?
The application is a simple days counter:
import datetime
from flask import Flask, render_template
app = Flask(__name__)
wsgi_app = app.wsgi_app
currentDate = datetime.date.today()
userInput = '07/22/2015'
targetdate = datetime.datetime.strptime(userInput, '%m/%d/%Y').date()
calc = targetdate - currentDate
msg=str(calc.days)
@app.route('/', methods=['GET','POST'])
def index():
return render_template('index.html', message=msg)
I have already gone through: This link to pythonAnywhere forum but is a script that i have to deploy on my pc and not on the application itself.
Question: How to automatically reload the application everyday? Is there any way of doing the same using schedule feature on the site?