-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
79 lines (56 loc) · 2.22 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#https://becominghuman.ai/full-stack-web-development-python-flask-javascript-jquery-bootstrap-802dd7d43053
#https://testdriven.io/blog/adding-a-custom-stripe-checkout-to-a-flask-app/
#https://www.tutorialspoint.com/flask/flask_templates.htm
#https://www.digitalocean.com/community/tutorials/how-to-structure-large-flask-applications
#https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world
#test out GoCD
#https://docs.sqlalchemy.org/en/13/orm/session_basics.html
#https://realpython.com/python-web-applications-with-flask-part-ii/
#https://pusher.com/tutorials/live-table-flask
"""This is the routing file - all pages of website will be directed from here"""
from application import create_app, cli
# Create the flask application
flask_app = create_app()
# Register custom CLI commands
cli.register(flask_app)
# if __name__ == "__main__":
# flask_app.run(host='192.168.1.214', port=8081)
if __name__ == "__main__":
flask_app.run(host='127.0.0.1', port=80)
"""
import stripe
from flask import Flask, render_template, jsonify, flash, redirect
from datetime import datetime
flask_app = Flask(__name__)
#from app import routes
#Routing for the home page
@flask_app.route("/")
def index():
now = datetime.now()
formatted_now = now.strftime("%A, %d, %B, %Y at %X")
content = "Hello, the time is " + formatted_now
return render_template('index.html', key=formatted_now)
#Routing for the registration page
@flask_app.route("/register")
def register():
return "Registration"
#Routing for the blog redirect
@flask_app.route("/blog")
def blog():
return redirect("https://blog.orientation.skule.ca/")
#Routing for the FAQ page
@flask_app.route("/faq")
def faq():
return "FAQ Page"
#Routing for the Events and Schedule page
@flask_app.route("/schedule")
def schedule():
content = "this c'est un test"
return content
#This runs the app when the file is run using 'python app.py' instead of having to run it using 'flask run
if __name__ == "__main__":
flask_app.run()
#If want to pass in variables from the URL into the function
#@app.route('/meanreversion/result/<security>/<start_date>/<end_date>/<int:sma_>/<int:lma_>')
#def meanreversion_result(security,start_date,end_date,sma_,lma_):
"""