mirror of
https://github.com/ookangzheng/blahdns.git
synced 2025-12-17 06:35:38 +07:00
Site update and added Feedback page
This commit is contained in:
35
website/feedback/app.py
Executable file
35
website/feedback/app.py
Executable file
@@ -0,0 +1,35 @@
|
||||
from flask import Flask, render_template, request
|
||||
from send_mail import send_mail
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
ENV = 'dev'
|
||||
|
||||
if ENV == 'dev':
|
||||
app.debug = True
|
||||
|
||||
else:
|
||||
app.debug = False
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
return render_template('index.html')
|
||||
|
||||
|
||||
@app.route('/', methods=['POST'])
|
||||
def submit():
|
||||
if request.method == 'POST':
|
||||
customer = request.form['customer']
|
||||
email = request.form['email']
|
||||
rating = request.form['rating']
|
||||
comments = request.form['comments']
|
||||
# print(customer, rating, comments)
|
||||
if customer == '' or comments == '' or rating == '':
|
||||
return render_template('index.html', message='Please enter require fields')
|
||||
send_mail(customer, email, rating, comments)
|
||||
return render_template('index.html', message='Thanks for your feedback')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run()
|
||||
Reference in New Issue
Block a user