Development Island

CherryPy WSGI Setup Information

CherryPy is a pythonic, object-oriented HTTP framework.

Setup
CherryPy is supported with our Python package using WSGI.

Example application
Here is an example "script" that you can use to test your setup,

import sys
sys.stdout = sys.stderr

import atexit
import threading
import cherrypy

cherrypy.config.update({'environment': 'embedded'})

if cherrypy.engine.state == 0:
    cherrypy.engine.start(blocking=False)
    atexit.register(cherrypy.engine.stop)

class Root(object):
    def index(self):
        return 'Hello World!'
    index.exposed = True

application = cherrypy.Application(Root(), None)
						

Accessing your pages from the web
To access your page from a web browser or from a link in another page, you need to use a URL in the formats below, notice the ending slash.

  • http://www.jbloggs.devisland.net/wsgi/app.py

Or just like this for a relative link:

  • /wsgi/app.py