-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
29 lines (22 loc) · 1.05 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import datetime
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def root():
# For the sake of example, use static information to inflate the template.
# This will be replaced with real information in later steps.
dummy_times = [
datetime.datetime(2018, 1, 1, 10, 0, 0),
datetime.datetime(2018, 1, 2, 10, 30, 0),
datetime.datetime(2018, 1, 3, 11, 0, 0),
]
return render_template("index.html", times=dummy_times)
if __name__ == "__main__":
# This is used when running locally only. When deploying to Google App
# Engine, a webserver process such as Gunicorn will serve the app. This
# can be configured by adding an `entrypoint` to app.yaml.
# Flask's development server will automatically serve static files in
# the "static" directory. See:
# http://flask.pocoo.org/docs/1.0/quickstart/#static-files. Once deployed,
# App Engine itself will serve those files as configured in app.yaml.
app.run(host="127.0.0.1", port=8080, debug=True)