Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @app.route('/', methods=['GET','POST'])
- def index():
- if request.method == 'POST':
- db = sqlite3.connect('sql.sql3')
- db.row_factory = sqlite3.Row
- epass=getHash(request.form['postPass'])
- query="select username, password from users where username=? and password=?"
- t=(request.form['postUser'], epass)
- cursor=db.cursor()
- cursor.execute(query,t)
- rows = cursor.fetchall()
- if len(rows) ==1:
- bodyText=request.form['postUser'] + " " + request.form["postPass"]
- bodyText=bodyText + "Success!"
- session['authenticated']='yes'
- else:
- bodyText = "incorrect login."
- return render_template('/index.html')
- if request.method == 'GET':
- return render_template('/index.html')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement