One idea is to use a Pyramid "NotFound
view" (http://docs.pylonsproject.org/projects/pyramid/1.0/narr/hooks.html#changing-the-not-found-view) which delegates to the existing Pylons application, and port piecemeal. Unfortunately we don't have any current example of doing such a thing, but it would involve something like this during Pyramid configuration:
class LegacyView(object):
def __init__(self, app):
self.app = app # app is the legacy Pylons app
def __call__(self, request):
return request.get_response(self.app)
if __name__ == '__main__':
pylonsapp = ... obtain pylons WSGI application object ...
legacy_view = LegacyView(pylonsapp)
config = Configurator()
config.add_view(context=NotFound, view=legacy_view)
... rest of config ...
At that point, whenever Pyramid cannot service a request because the URL
doesn't match anything, it will invoke the Pylons application as a
fallback, which will return things normally.
At that point you can start moving logic incrementally into Pyramid from
the Pylons application until you've ported everything.
- C