From b310371a154a981dc48cb27744a45427c9de13a7 Mon Sep 17 00:00:00 2001 From: newwebash Date: Sat, 26 Sep 2020 12:58:28 -0400 Subject: [PATCH] set up gcloud testing resources --- main.py | 30 ++++++++++++++++++++++++++++++ requirements.txt | 3 +++ templates/index.html | 18 ++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 main.py create mode 100644 requirements.txt create mode 100644 templates/index.html diff --git a/main.py b/main.py new file mode 100644 index 0000000..473846b --- /dev/null +++ b/main.py @@ -0,0 +1,30 @@ +# main.py + +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) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1c1e590 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +# requirements.txt + +Flask==1.1.2 \ No newline at end of file diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..94f8358 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,18 @@ + + + + Datastore and Firebase Auth Example + + + + + +

Datastore and Firebase Auth Example

+ +

Last 10 visits

+ {% for time in times %} +

{{ time }}

+ {% endfor %} + + + \ No newline at end of file