Yipe, thanks for that. pyramid.wsgi.wsgiapp2 works with a small tweak as it doesn't support handling an object instance.
I know that it is meant to be a decorator on a method but I don't want my third party WSGI code to depend on pyramid so I am now trying to do the following:
wsgiapp = WSGIApp(app_config_settings)
config.add_view(pyramid.wsgi.wsgiapp2(wsgiapp), name = 'jinja2js')
I get an attribute error, when the decorate tries to wrap the __name__ attribute from my app. Which doesn't have a __name__ as it is an instance of a class. I will add an issue for this.
Thanks for the hint,
Michael