CORS handling as a cherrypy tool.
Project description
cherrypy_cors
CORS support for CherryPy
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,
}
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cherrypy-cors-1.4.1.tar.gz
(6.4 kB
view hashes)
Built Distribution
Close
Hashes for cherrypy_cors-1.4.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f32a2bcf402f805777eaaed518619c1b20e4318727f61620aa5449de1822b4e |
|
MD5 | c6d267f82328b7333bdfa5d5297005a4 |
|
BLAKE2b-256 | c6d2091d65855e52d2882445c18e86d1a8acedb7d809bb7f058e5dcf3b7a94d5 |