~dkuhlman/python-training-materials/Materials

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from pyramid.config import Configurator


def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """
    config = Configurator(settings=settings)
    config.include('pyramid_chameleon')
    config.add_static_view('static', 'static', cache_max_age=3600)

    config.add_route('help_view', '/')
    config.add_route('list_view', '/list')
    config.add_route('get_view', '/get/{doc_id}')
    config.add_route('search_view', '/search/{tag}')

    config.scan()
    return config.make_wsgi_app()