diff --git a/app/main/views/styleguide.py b/app/main/views/styleguide.py index 793fe40d5..e2b540708 100644 --- a/app/main/views/styleguide.py +++ b/app/main/views/styleguide.py @@ -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()]) diff --git a/config.py b/config.py index bc1ae87db..bdd7be9af 100644 --- a/config.py +++ b/config.py @@ -44,6 +44,8 @@ class Config(object): AWS_REGION = 'eu-west-1' + SHOW_STYLEGUIDE = True + class Development(Config): DEBUG = True @@ -66,7 +68,7 @@ class Preview(Config): class Staging(Preview): - pass + SHOW_STYLEGUIDE = False class Live(Staging):