Hi all
I'm making some changes in an old application that uses trac edgewall, being my first interaction with trac and CherryPy
The thing is, the application that is on production now is something like this:
wsgi.py
def application(environ, start_response):
if something(): # this is just an example
return []
else:
return trac.web.main.dispatch_request(environ, start_response)
trac.web.main.dispatch_request is the trac wsgi application
But now, I need to put a cherrypy application in the middle so:
def application(environ, start_response):
root = Trac()
root.openid = Auth()
cherrypy.tree.mount(root, "/", config=conf)
return cherrypy.tree(environ, start_response)
And this works until the part that I must gave control to trac.web.main.dispatch_request
Inside cherrypy objects I cannot find start_response callback
And doing something like:
env = None
sr = None
class Trac():
@cherrypy.expose
def index(self):
return trac.web.main.dispatch_request(env, sr)
def application(environ, start_response):
env = environ
sr = start_response
root = Trac()
root.openid = Auth()
cherrypy.tree.mount(root, "/", config=conf)
return cherrypy.tree(environ, start_response)
Also don't work throwing an error that response headers already been started.
Any ideas how to I can capture start_response inside my CP application
Thank you in advance
Kind regards,
Emanuel