move html to templates folder
This commit is contained in:
parent
a3d1d44bb3
commit
a1d438f04d
2 changed files with 12 additions and 15 deletions
|
@ -1,6 +1,7 @@
|
|||
from flask import Flask,render_template
|
||||
import datetime
|
||||
|
||||
from flask import Flask, render_template
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
# We request users to send the run number to prevent accidentially getting old requests from a previous run
|
||||
|
@ -12,28 +13,23 @@ app = Flask(__name__)
|
|||
# Save progress through time during 1 run
|
||||
# Save result of different runs
|
||||
|
||||
db = {
|
||||
"current_run": 0,
|
||||
"run_start_timer": None,
|
||||
"run_data": {
|
||||
}
|
||||
}
|
||||
db = {"current_run": 0, "run_start_timer": None, "run_data": {}}
|
||||
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
return render_template("index.html")
|
||||
return render_template('index.html')
|
||||
|
||||
|
||||
@app.route("/start_run/<run_index>")
|
||||
def start_run(run_index):
|
||||
db["current_run"] = run_index
|
||||
starttime = datetime.datetime.now()
|
||||
db["run_data"][run_index] = {
|
||||
"starttime": starttime,
|
||||
"data": {}
|
||||
}
|
||||
db["run_data"][run_index] = {"starttime": starttime, "data": {}}
|
||||
# TODO send start request to the first person in the chain. Probably a zeus part already written as example
|
||||
return f'Run {run_index} started at {starttime}'
|
||||
|
||||
|
||||
@app.route("/checkpoint/start/<run>/<index>")
|
||||
def checkpoint_start(run, index):
|
||||
if db["current_run"] != run:
|
||||
|
@ -51,5 +47,6 @@ def checkpoint_handoff(run, index):
|
|||
db["run_data"][run]["data"][index]["handoff"] = datetime.datetime.now()
|
||||
return "Success."
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True)
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<h1></h1>
|
||||
<h1>TEST</h1>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue