Example #1
0
from flask import Flask
from flask_boilerplate_utils import Boilerplate
from flask_menu import Menu

app = Flask(__name__)

from .config import get_config_class

config_cls = get_config_class()
app.config_class = config_cls()
app.config.from_object(app.config_class)

# Use Boilerplate extensions
Boilerplate(app)

# Patch the render_template method too.
# (This gives us relative template rendering for blueprints)
from flask_boilerplate_utils.overrides import monkey_patch_all

monkey_patch_all()

# Setup Flask Menu
Menu(app)

# Setup db
from flask.ext.sqlalchemy import SQLAlchemy

db = SQLAlchemy(app)


from flask.ext.migrate import Migrate
Example #2
0
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.security import Security, SQLAlchemyUserDatastore
from flask_mail import Mail
from flask_boilerplate_utils import Boilerplate

# from flask_boilerplate_utils.menu import Menu
from flask.ext.menu import Menu

#  Initial App Setup
app = Flask(__name__)

# Configure the app.
import config

app.config_class = config.get_config()
app.config.from_object(app.config_class)

# Initialise the boilerplate and do Configuration Magic.
Boilerplate(app)
# Menu(app)
# Setup flask menu
Menu(app)

# Setup the ORM.
import models

app.db = SQLAlchemy(app)
app.db.register_base(models.Base)

# Setup Flask-Security