Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yougov/cherrypy-cors
https://github.com/yougov/cherrypy-cors
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/yougov/cherrypy-cors
- Owner: yougov
- Created: 2016-02-04T02:12:21.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-20T13:52:30.000Z (over 7 years ago)
- Last Synced: 2024-04-16T07:16:25.317Z (9 months ago)
- Language: Python
- Size: 66.4 KB
- Stars: 10
- Watchers: 5
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
Awesome Lists containing this project
README
.. image:: https://img.shields.io/pypi/v/cherrypy_cors.svg
:target: https://pypi.io/project/cherrypy_cors.. image:: https://img.shields.io/pypi/pyversions/cherrypy_cors.svg
.. image:: https://img.shields.io/pypi/dm/cherrypy_cors.svg
.. image:: https://img.shields.io/travis/yougov/cherrypy-cors/master.svg
:target: http://travis-ci.org/yougov/cherrypy-corsCORS 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.
.. code-block:: python
import cherrypy_cors
cherrypy_cors.install()Or add it to your application explicitly.
.. code-block:: python
import cherrypy_cors
app = cherrypy.tree.mount(...)
app.toolboxes['cors'] = cherrypy_cors.toolsThen, enable it in your cherrypy config. For example, to enable it for all
static resources... code-block:: python
config = {
'/static': {
'tools.staticdir.on': True,
'cors.expose.on': True,
}
}See `simple-example
`_
for a runnable example.