Skip to content

cherrypy/cherrypy-cors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

936555b · Feb 26, 2025
Feb 23, 2025
Aug 28, 2023
Sep 11, 2024
Aug 8, 2024
Jun 16, 2022
Oct 25, 2024
Feb 24, 2025
Apr 11, 2023
Aug 28, 2023
Feb 26, 2025
Aug 29, 2024
Oct 29, 2024
Mar 31, 2024
Feb 26, 2025
Aug 28, 2023
Aug 28, 2023
Jun 21, 2023
Aug 31, 2024

Repository files navigation

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