Рефракторинг

This commit is contained in:
2020-03-13 23:02:18 +03:00
parent 9e48f8a8d6
commit 4f3ff66760
5 changed files with 198 additions and 161 deletions

View File

@@ -1,6 +1,9 @@
from flask import Flask, render_template
from flask import Flask, render_template, flash, redirect, url_for, session, logging, request
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__, static_folder="static", template_folder="templates")
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///data.db'
db = SQLAlchemy(app)
@app.route('/', methods=['GET'])
@@ -8,9 +11,26 @@ def index():
return render_template('index.html')
@app.route('/login', methods=['GET'])
def login():
return render_template('login.html')
@app.route("/registration", methods=["GET", "POST"])
def register():
if request.method == "POST":
UserLogin = request.form['login']
UserPass = request.form['password']
#db.session.add(UserLogin, UserPass)
#db.session.commit()
#return redirect(url_for(""))
print(UserLogin, ' ', UserPass)
return render_template("registration.html")
# @app.route('/login', methods=['GET'])
# def login():
# return render_template('login.html')
if __name__ == "__main__":