Files
Jarvis/__init__.py
2020-03-13 23:39:46 +03:00

39 lines
977 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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'])
def index():
return render_template('index.html')
@app.route("/registration", methods=["GET", "POST"])
def register():
if request.method == "POST":
UserLogin = request.form['UserLogin']
UserPass = request.form['UserPass']
#db.session.add(UserLogin, UserPass)
#db.session.commit()
#return redirect(url_for(""))
print(UserLogin, ' ', UserPass)
# return страница с контентом
return render_template("registration.html")
# @app.route('/login', methods=['GET'])
# def login():
# return render_template('login.html')
if __name__ == "__main__":
app.run()