skip to navigation
skip to content

cherrypy-cors 1.6

CORS handling as a cherrypy tool.

CORS support for CherryPy

License

License is indicated in the project metadata (typically one or more of the Trove classifiers). For more details, see this explanation.

In a nutshell

In your application, either install the tool globally.

import cherrypy_cors
cherrypy_cors.install()

Or add it to your application explicitly.

import cherrypy_cors
app = cherrypy.tree.mount(...)
app.toolboxes['cors'] = cherrypy_cors.tools

Then, enable it in your cherrypy config. For example, to enable it for all static resources.

config = {
    '/static': {
        'tools.staticdir.on': True,
        'cors.expose.on': True,
    }
}

See simple-example for a runnable example.

 
File Type Py Version Uploaded on Size
cherrypy-cors-1.6.tar.gz (md5) Source 2017-09-20 9KB
cherrypy_cors-1.6-py2.py3-none-any.whl (md5) Python Wheel py2.py3 2017-09-20 5KB