I successfully deployed the demo web app that comes with Jython. It uses modjy which is a Jython WSGI gateway. I'm now trying to hook modjy to my Flask app. I get a handler not defined error.
The full traceback is here: http://pastie.org/2810227
There are two different ways you can specify an application to modjy:
For the first method simply create a file that imports your Flask app object.
from my_flask_app import app as application
Then in your web.xml set the proper init-param:
<init-param>
<param-name>app_import_name</param-name>
<param-value>wsgi.application</param-value>
</init-param>
For the second method you can use the modjy convention of defining application.py in the servlet context root with a single handler method that invokes the Flask WSGI app:
def handler(environ, start_response):
return application.wsgi_app(environ, start_response)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.