Skip to main content

CORS handling as a cherrypy tool.

Project description

cherrypy_cors

CORS support for CherryPy

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

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.5.tar.gz (9.1 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.5-py2.py3-none-any.whl (5.3 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for cherrypy-cors-1.5.tar.gz
Algorithm Hash digest
SHA256 5866ec72ba74cda8162c2c32b55c17c2d7a36e436f5ba760b3ec196cb9c4b6a2
MD5 c1c323cf8e946593a2804164e2e2458c
BLAKE2b-256 3c5a506ee85b448b38a927fcd22a47e5174e45f427cbb6acf132df60e69958f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cherrypy_cors-1.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 20a74d1797988dbf397a242b6ac0920d3565ada617bfc2d069bbe584f7aac890
MD5 a655126fdf384ebd837dffb58e4f1d27
BLAKE2b-256 88ca923738b329902f26899b33b136f61702df36563c7a61ee148168f6be6aa4

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