CORS handling as a cherrypy tool.
Project description
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,
}
}
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.7.0.tar.gz
(10.3 kB
view hashes)
Built Distribution
Close
Hashes for cherrypy_cors-1.7.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cdeddcad89efba5a7bed06ed80150ef7cc418899209e6507481e84be7df6eea |
|
MD5 | e298b862def5ba6d91e4c4799217b100 |
|
BLAKE2b-256 | d70501d4deda775d3a84d172719ebd1cb5314487377a128e892208b0a9533fc5 |