CORS handling as a cherrypy tool.
Project description
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.
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.6.tar.gz
(9.5 kB
view hashes)
Built Distribution
Close
Hashes for cherrypy_cors-1.6-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb512e20fa9e478abd1868b1417814a4e9240ed0c403472a2c624460e49ab0d5 |
|
MD5 | b2e4b998274d456f968bdadaa1482751 |
|
BLAKE2b-256 | 8ceb2dde33117abfb7a856e0ed2f554f0f4ad97477465c7708a53531e3661370 |