|
|
@ -9,9 +9,7 @@ from {{cookiecutter.repo_name}}.public.forms import RegisterForm, LoginForm |
|
|
|
from {{cookiecutter.repo_name}}.utils import flash_errors |
|
|
|
from {{cookiecutter.repo_name}}.utils import flash_errors |
|
|
|
from {{cookiecutter.repo_name}}.database import db |
|
|
|
from {{cookiecutter.repo_name}}.database import db |
|
|
|
|
|
|
|
|
|
|
|
blueprint = Blueprint('public', __name__, |
|
|
|
blueprint = Blueprint('public', __name__, static_folder="../static") |
|
|
|
static_folder="../static", |
|
|
|
|
|
|
|
template_folder="../templates") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@blueprint.route("/", methods=["GET", "POST"]) |
|
|
|
@blueprint.route("/", methods=["GET", "POST"]) |
|
|
@ -27,7 +25,7 @@ def home(): |
|
|
|
session['username'] = u.username |
|
|
|
session['username'] = u.username |
|
|
|
flash("You are logged in.", 'success') |
|
|
|
flash("You are logged in.", 'success') |
|
|
|
return redirect(url_for("user.members")) |
|
|
|
return redirect(url_for("user.members")) |
|
|
|
return render_template("home.html", form=form) |
|
|
|
return render_template("public/home.html", form=form) |
|
|
|
|
|
|
|
|
|
|
|
@blueprint.route('/logout/') |
|
|
|
@blueprint.route('/logout/') |
|
|
|
def logout(): |
|
|
|
def logout(): |
|
|
@ -50,7 +48,7 @@ def register(): |
|
|
|
flash("That username and/or email already exists. Try again.", 'warning') |
|
|
|
flash("That username and/or email already exists. Try again.", 'warning') |
|
|
|
else: |
|
|
|
else: |
|
|
|
flash_errors(form) |
|
|
|
flash_errors(form) |
|
|
|
return render_template('register.html', form=form) |
|
|
|
return render_template('public/register.html', form=form) |
|
|
|
|
|
|
|
|
|
|
|
@blueprint.route("/about/") |
|
|
|
@blueprint.route("/about/") |
|
|
|
def about(): |
|
|
|
def about(): |
|
|
|