Source code for pythonie.application
"""An application composed of blueprints
"""
import os
import flask
from pythonie.blueprints import (
blueprints,
database,
signals,
templates,
)
app = flask.Flask(__name__)
@app.route("/")
[docs]def index():
"""
To see this in action go to http://building-webapps-with-flask.herokuapp.com/
"""
return flask.make_response("Hello World")
app.register_blueprint(blueprints.blueprint, url_prefix="/blueprints")
app.register_blueprint(templates.blueprint, url_prefix="/templates")
app.register_blueprint(signals.blueprint, url_prefix="/signals")
app.register_blueprint(database.blueprint, url_prefix="/database")
# Configure using this module
DATABASE = os.environ.get("DATABASE_URL", "sqlite:////tmp/flask.db") # Use heroku URL if available
app.config.from_object(__name__)