-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflask_app.py
30 lines (24 loc) · 868 Bytes
/
flask_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
from flask import Flask,redirect,url_for,render_template,request
from dump import get_dump
from db import connection, sql, create_tables
from users import add_user, create_test_data
app=Flask(__name__)
create_tables()
#create_test_data()
@app.route('/',methods=['GET','POST'])
def home():
current_user="Kathirrrrrrrr"
if request.method=='POST':
# Handle POST Request here
return render_template('home.html', user=current_user)
return render_template('home.html', user=current_user)
@app.route('/dump',methods=['GET','POST'])
def dump():
dump = get_dump()
if request.method=='POST':
# Handle POST Request here
return render_template('dump.html', dump=dump)
return render_template('dump.html', dump=dump)
if __name__ == '__main__':
#DEBUG is SET to TRUE. CHANGE FOR PROD
app.run(port=5000,debug=True)