Example #1
0
import os
import settings
from datetime import date, timedelta
from flask import Flask, request, session
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.markdown import Markdown
from standup.errors import register_error_handlers
from standup.filters import register_filters

app = Flask(__name__)
app.debug = getattr(settings, "DEBUG", False)
app.config["SITE_TITLE"] = getattr(settings, "SITE_TITLE", "Standup")
app.config["SQLALCHEMY_DATABASE_URI"] = os.environ.get("DATABASE_URL", "sqlite:///standup_app.db")
app.secret_key = settings.SESSION_SECRET
db = SQLAlchemy(app)
Markdown(app)

# Register error handlers
register_error_handlers(app)

# Register template filters
register_filters(app)

# Register blueprints
for blueprint in settings.BLUEPRINTS:
    app.register_blueprint(getattr(__import__(blueprint, fromlist=["blueprint"]), "blueprint"))


@app.context_processor
def inject_page():
    return dict(page=int(request.args.get("page", 1)))
Example #2
0
# -*- coding: utf-8 -*-
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.babel import Babel


app = Flask("pasticcio")
db = SQLAlchemy(app)
babel = Babel(app)

app.config["SITE_TITLE"] = "Pasticcio"