forked from tinkerhub/stackup-teamplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
33 lines (25 loc) · 1.06 KB
/
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
# from flask import Flask, render_template, request
# from flask_sqlalchemy import SQLAlchemy
# from werkzeug.security import generate_password_hash, check_password_hash
# app = Flask(__name__)
# app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///users.db'
# db = SQLAlchemy(app)
# class User(db.Model):
# id = db.Column(db.Integer, primary_key=True)
# username = db.Column(db.String(80), unique=True, nullable=False)
# password = db.Column(db.String(120), nullable=False)
# # Create the database tables
# db.create_all()
# @app.route('/', methods=['GET', 'POST'])
# def login():
# if request.method == 'POST':
# username = request.form['username']
# password = request.form['password']
# user = User.query.filter_by(username=username).first()
# if user and check_password_hash(user.password, password):
# return "Login successful!"
# else:
# return "Invalid username or password. Please try again."
# return render_template('login.html')
# if __name__ == '__main__':
# app.run(debug=True)