Reorganize public templates

master
Steven Loria 11 years ago
parent 4dad84074b
commit f99f3e76b3
  1. 8
      {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/public/views.py
  2. 0
      {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/templates/public/about.html
  3. 0
      {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/templates/public/home.html
  4. 0
      {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/templates/public/register.html
  5. 3
      {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/user/views.py

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

@ -3,7 +3,8 @@ from flask import Blueprint, render_template
from {{cookiecutter.repo_name}}.utils import login_required
blueprint = Blueprint("user", __name__, url_prefix='/users')
blueprint = Blueprint("user", __name__, url_prefix='/users',
static_folder="../static")
@blueprint.route("/")

Loading…
Cancel
Save