You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
wowstash/wowstash/blueprints/authentication/routes.py

28 lines
832 B

from flask import request, render_template, session, redirect, url_for
from wowstash.blueprints.authentication import authentication_bp
from wowstash.forms import Register
from wowstash.models import User
@authentication_bp.route("/register", methods=["GET", "POST"])
def register():
form = Register()
if form.validate_on_submit():
print(dir(User))
# user = User.query
user = User.objects.filter(email=form.email.data)
print(user)
return "ok"
else:
print(form)
return render_template("authentication/register.html", form=form)
@authentication_bp.route("/login", methods=["GET", "POST"])
def login():
return render_template("authentication/login.html")
@authentication_bp.route("/logout")
def logout():
session.clear()
return redirect(url_for('index'))