Created
January 4, 2015 20:37
-
-
Save inklesspen/ed380f3d6dbc879c5dd3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyramid.config import Configurator | |
from sqlalchemy import engine_from_config | |
from .models import ( | |
DBSession, | |
Base, | |
) | |
def main(global_config, **settings): | |
""" This function returns a Pyramid WSGI application. | |
""" | |
engine = engine_from_config(settings, 'sqlalchemy.') | |
DBSession.configure(bind=engine) | |
Base.metadata.bind = engine | |
config = Configurator(settings=settings) | |
config.include('pyramid_chameleon') | |
config.add_static_view('static', 'static', cache_max_age=3600) | |
config.add_route('home', '/') | |
config.scan() | |
return config.make_wsgi_app() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment