Source

client_template_demo / template_demo / application.py

from pyramid.config import Configurator
from .renderers import MakoRenderer
from .renderers import HandlebarsRenderer

def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """
    config = Configurator(settings=settings)
    config.add_static_view('static', 'static', cache_max_age=3600)
    config.add_renderer('.mako', MakoRenderer)
    config.add_renderer('.handlebars', HandlebarsRenderer)

    config.add_route('home', '/')
    config.add_route('client_data', '/client_view')
    config.add_route('server_data', '/server_view')
    config.add_route('api_data', '/api_view')

    config.scan()
    return config.make_wsgi_app()