-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
33 lines (24 loc) · 738 Bytes
/
app.py
File metadata and controls
33 lines (24 loc) · 738 Bytes
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
from qrgen import qrgen
from flask import *
app = Flask(__name__)
@app.route("/")
def home():
return render_template("index.html")
# @app.route('/qrconvert',methods=['POST'])
# def convert():
# global url
# url = request.form['url']
# return render_template("index.html")
# @app.route('/download',methods=['POST','GET'])
# def qr_download():
# filename=qrgen(url)
# return send_file(filename,as_attachment=True)
@app.route('/qrconvert',methods=['POST','GET'])
def convert():
global url
url = request.form['url']
filename=qrgen(url)
return send_file(filename,as_attachment=True)
# return render_template("index.html")
if __name__=="__main__":
app.run(host='0.0.0.0',port='5000')