forked from xboxertony/taipei-day-trip-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
49 lines (37 loc) · 1.04 KB
/
app.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
from dotenv import load_dotenv
load_dotenv()
from flask import *
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from model import *
from config import Config
app=Flask(__name__)
app.config.from_object(Config)
db.init_app(app)
migrate = Migrate(app,db,compare_type=True)
# Pages
@app.route("/")
def index():
return render_template("index.html")
@app.route("/attraction/<id>")
def attraction(id):
return render_template("attraction.html")
@app.route("/booking")
def booking():
if 'name' not in session:
return redirect('/')
return render_template("booking.html")
@app.route("/thankyou")
def thankyou():
number = request.args.get('number')
return render_template("thankyou.html")
from view.book_api import book_api
from view.attraction_api import att_api
from view.user_api import user_api
from view.order import order_api
app.register_blueprint(att_api)
app.register_blueprint(user_api)
app.register_blueprint(book_api)
app.register_blueprint(order_api)
if __name__ == '__main__':
app.run(host='0.0.0.0',port=3000)