Deploying CherryPy application using gunicorn
I have a basic application written in CherryPy. It looks something like this:
import cherrypy
class API():
@cherrypy.expose
def index(self):
return "<h3>Its working!<h3>"
if __name__ == '__main__':
cherrypy.config.update({
'server.socket_host': '127.0.0.1',
'server.socket_port': 8082,
})
cherrypy.quickstart(API())
I would like to deploy this application with a cannon, possibly with multiple workers. gunicorn starts up when I run this in terminal
gunicorn -b localhost:8082 -w 4 test_app:API
But every time I try to access the default method it gives an internal server error. However, running this standalone using CherryPy works.
Here is the error:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/sync.py", line 130, in handle
self.handle_request(listener, req, client, addr)
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/sync.py", line 171, in handle_request
respiter = self.wsgi(environ, resp.start_response)
TypeError: this constructor takes no arguments
I have a fairly large CherryPy application that I would like to deploy using gunicorn. Should CherryPy and gunicorn be mixed?
+3
source to share
No one has answered this question yet
Check out similar questions:
eleven