-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
39 lines (27 loc) · 859 Bytes
/
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
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 25 12:02:51 2020
@author: hp
"""
from flask import Flask, render_template, request, flash, redirect,url_for, jsonify, session
from flask import Response,send_file
app = Flask(__name__)
import rds_db as db
@app.route('/')
def index():
return render_template('index.html')
@app.route('/insert',methods = ['post'])
def insert():
if request.method == 'POST':
name = request.form['name']
email = request.form['email']
gender = request.form['optradio']
comment = request.form['comment']
db.insert_details(name,email,comment,gender)
details = db.get_details()
print(details)
for detail in details:
var = detail
return render_template('index.html',var=var)
if __name__ == "__main__":
app.run(debug=True)