WSGI Server Environment Variables
Ryan Belgrave <[email protected]>
| Newsgroups | gmane.comp.python.cherrypy |
|---|---|
| Message-ID | <[email protected]> |
So I am trying to use cherrypy as a WSGI server to host an application.
Everything works fine asside from environment variables. I can't figure out
a way to pass environment variables into the application.
My current code is as follows
# Mount the application
cherrypy.tree.graft(application, "/")
# Unsubscribe the default server
cherrypy.server.unsubscribe()
# Disable cherrpy's logging
cherrypy.log.error_log.propagate = False
cherrypy.log.access_log.propagate = False
# Instantiate a new server object
server = cherrypy._cpserver.Server()
# Configure the server object
server.socket_host = args.socket_host
server.socket_port = args.socket_port
server.thread_pool = 30
print(cherrypy.tree)
# Configure the cherrypy engine
cherrypy.config.update({
'engine.autoreload.on': False,
'engine.timeout_monitor.on': False
})
# Subscribe this server
server.subscribe()
cherrypy.engine.start()
cherrypy.engine.block()
If someone can lend me a hand that would be great.
Thanks :)
--
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To post to this group, send email to cherrypy-users-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.