Don’t show styleguide on live environment

Its audience is people working on the product, not the end users.
This commit is contained in:
Chris Hill-Scott
2016-02-15 11:47:54 +00:00
parent 10a92258a4
commit 0d86be0feb
2 changed files with 7 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
from flask import render_template
from flask import render_template, current_app, abort
from flask_wtf import Form
from wtforms import StringField, PasswordField, TextAreaField, FileField, validators
from app.main import main
@@ -7,6 +7,9 @@ from app.main import main
@main.route('/_styleguide')
def styleguide():
if not current_app.config['SHOW_STYLEGUIDE']:
abort(404)
class FormExamples(Form):
username = StringField(u'Username')
password = PasswordField(u'Password', [validators.required()])