Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from flask import Flask,render_template,request,url_for
- import pymysql
- app = Flask(__name__)
- db = pymysql.connect('localhost','root','','imsDB')
- @app.route('/')
- def home():
- cur = db.cursor()
- cur.execute("select * from costomer")
- costomer = cur.fetchall()
- print(costomer)
- return render_template('index.html',datacostomer=costomer)
- @app.route('/test', methods=['GET', 'POST'])
- def test():
- select = request.form['Customer_Type']
- print(select)
- print("test")
- return (str(select))
- if __name__ == '__main__':
- app.run(debug=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement