-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathapp1.py
51 lines (42 loc) · 1.43 KB
/
app1.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
from flask import Flask,redirect, url_for,render_template,request
import os
from index import d_dtcn
secret_key = str(os.urandom(24))
app = Flask(__name__)
app.config['TESTING'] = True
app.config['DEBUG'] = True
app.config['FLASK_ENV'] = 'development'
app.config['SECRET_KEY'] = secret_key
app.config['DEBUG'] = True
# Defining the home page of our site
@app.route("/",methods=['GET', 'POST'])
def home():
print(request.method)
if request.method == 'POST':
if request.form.get('Continue') == 'Continue':
return render_template("test1.html")
else:
# pass # unknown
return render_template("index.html")
@app.route("/start", methods=['GET', 'POST'])
def index():
print(request.method)
if request.method == 'POST':
if request.form.get('Start') == 'Start':
# pass
d_dtcn()
return render_template("index.html")
else:
# pass # unknown
return render_template("index.html")
@app.route('/contact', methods=['GET', 'POST'])
def cool_form():
if request.method == 'POST':
# do stuff when the form is submitted
# redirect to end the POST handling
# the redirect can be to the same route or somewhere else
return redirect(url_for('index'))
# show the form, it wasn't submitted
return render_template('contact.html')
if __name__ == "__main__":
app.run()