Example #1
0
from flask import make_response, jsonify, render_template
import flask.ext.assets
from webassets.ext.jinja2 import AssetsExtension
from webassets import Environment as AssetsEnvironment



from database import db_session
from models import *
from base import *
import utilities


app = utilities.init_flask(__name__)
assets = flask.ext.assets.Environment()
assets.init_app(app)



assets_env = AssetsEnvironment('./static/', '/static')
jinja_environment = jinja2.Environment(
    autoescape=True,
    loader=jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), "templates")),
    extensions=[AssetsExtension])
jinja_environment.assets_environment = assets_env


@app.teardown_appcontext
def shutdown_session(exception=None):
    db_session.remove()
Example #2
0
import time

import jinja2
from flask import make_response, jsonify, render_template, Response
import flask.ext.assets
from webassets.ext.jinja2 import AssetsExtension
from webassets import Environment as AssetsEnvironment

from database import db_session
from models import *
from base import *
import utilities

app = utilities.init_flask(__name__)
assets = flask.ext.assets.Environment()
assets.init_app(app)

assets_env = AssetsEnvironment('./static/', '/static')
jinja_environment = jinja2.Environment(autoescape=True,
                                       loader=jinja2.FileSystemLoader(
                                           os.path.join(
                                               os.path.dirname(__file__),
                                               "templates")),
                                       extensions=[AssetsExtension])
jinja_environment.assets_environment = assets_env

MINIMAL_ZOOM = 16


@app.teardown_appcontext
def shutdown_session(exception=None):