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 tests Ruff Code style: Black https://readthedocs.org/projects/cherrypy-cors/badge/?version=latest https://img.shields.io/badge/skeleton-2023-informational

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

Uploaded Source

Built Distribution

cherrypy_cors-1.7.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cherrypy-cors-1.7.0.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for cherrypy-cors-1.7.0.tar.gz
Algorithm Hash digest
SHA256 83384cd664a7ab8b9ab7d4926fe9713acfe0bce3665ee28189a0fa04b9f212d6
MD5 bfa2c24aebf9fecb8a6163421aa708f9
BLAKE2b-256 e0c3d62ce781e2e2be9c2d4c5670f0bff518dc1b00396e2ce135dbfdcd4f1b9d

See more details on using hashes here.

File details

Details for the file cherrypy_cors-1.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cherrypy_cors-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9cdeddcad89efba5a7bed06ed80150ef7cc418899209e6507481e84be7df6eea
MD5 e298b862def5ba6d91e4c4799217b100
BLAKE2b-256 d70501d4deda775d3a84d172719ebd1cb5314487377a128e892208b0a9533fc5

See more details on using hashes here.

Supported by

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