class RootFactory(object):

    def __init__(self, request):
        self._request = request
self.__acl__ = [(Allow, Everyone, 'view')]

@view_config(permission='view', route_name='orders')
def view_product(context, request):
    order_id, product_id = request.matchdict['order_id'], request.matchdict[
        'product_id']
pass
config = Configurator(root_factory=RootFactory)
config.add_route(name='orders', path='/order/{order_id}/products/{product_id}')
config.scan()
application = config.make_wsgi_app()
Ресурс пирамиды: на простом английском языке