Source

PylonsWikiNG / src / layout / tutorial / __init__.py

Full commit
def main(global_config, **settings):
    """ This function returns a Pylons WSGI application.
    """
    from pylons.configuration import Configurator
    from tutorial.models import initialize_sql
    db_string = settings.get('db_string')
    if db_string is None:
        raise ValueError("No 'db_string' value in application "
                         "configuration.")
    initialize_sql(db_string)
    config = Configurator(settings=settings)
    config.begin()
    config.add_static_view(
        'static',
        'tutorial:templates/static'
        )
    config.add_handler(
        route_name='action',
        pattern='/{action}',
        handler='tutorial.handlers:MyHandler',
        )
    config.add_handler(
        route_name='home',
        pattern='/',
        handler='tutorial.handlers:MyHandler',
        action='index'
        )
    config.end()
    return config.make_wsgi_app()