Skip to main content

CORS handling as a cherrypy tool.

Project description

https://img.shields.io/pypi/v/cherrypy_cors.svg https://img.shields.io/pypi/pyversions/cherrypy_cors.svg https://img.shields.io/pypi/dm/cherrypy_cors.svg https://img.shields.io/travis/yougov/cherrypy-cors/master.svg

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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cherrypy_cors-1.6-py2.py3-none-any.whl (6.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file cherrypy-cors-1.6.tar.gz.

File metadata

  • Download URL: cherrypy-cors-1.6.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cherrypy-cors-1.6.tar.gz
Algorithm Hash digest
SHA256 f7fb75f6e617ce29c9ec3fdd8b1ff6ec64fec2c56371182525e22bcf4c180513
MD5 0bc45e2d0af3013ca589c5fe912212e7
BLAKE2b-256 488ccff674e8ba0fbe12ddee8b106ff7793c0d42e2a5153bd7882d01d5178edd

See more details on using hashes here.

File details

Details for the file cherrypy_cors-1.6-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for cherrypy_cors-1.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 eb512e20fa9e478abd1868b1417814a4e9240ed0c403472a2c624460e49ab0d5
MD5 b2e4b998274d456f968bdadaa1482751
BLAKE2b-256 8ceb2dde33117abfb7a856e0ed2f554f0f4ad97477465c7708a53531e3661370

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page