.. image:: https://img.shields.io/pypi/v/cherrypy-cors.svg
:target: https://pypi.org/project/cherrypy-cors
.. image:: https://img.shields.io/pypi/pyversions/cherrypy-cors.svg
.. image:: https://github.com/cherrypy/cherrypy-cors/workflows/tests/badge.svg
:target: https://github.com/cherrypy/cherrypy-cors/actions?query=workflow%3A%22tests%22
:alt: tests
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json
:target: https://github.com/astral-sh/ruff
:alt: Ruff
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Code style: Black
.. image:: https://readthedocs.org/projects/cherrypy-cors/badge/?version=latest
:target: https://cherrypy-cors.readthedocs.io/en/latest/?badge=latest
.. image:: https://img.shields.io/badge/skeleton-2023-informational
:target: https://blog.jaraco.com/skeleton
CORS support for CherryPy
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.tools
Then, 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
<https://github.com/yougov/cherrypy-cors/blob/master/simple-example.py>`_
for a runnable example.
Raw data
{
"_id": null,
"home_page": "https://github.com/cherrypy/cherrypy-cors",
"name": "cherrypy-cors",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "",
"author": "Jason R. Coombs",
"author_email": "jaraco@jaraco.com",
"download_url": "https://files.pythonhosted.org/packages/e0/c3/d62ce781e2e2be9c2d4c5670f0bff518dc1b00396e2ce135dbfdcd4f1b9d/cherrypy-cors-1.7.0.tar.gz",
"platform": null,
"description": ".. image:: https://img.shields.io/pypi/v/cherrypy-cors.svg\n :target: https://pypi.org/project/cherrypy-cors\n\n.. image:: https://img.shields.io/pypi/pyversions/cherrypy-cors.svg\n\n.. image:: https://github.com/cherrypy/cherrypy-cors/workflows/tests/badge.svg\n :target: https://github.com/cherrypy/cherrypy-cors/actions?query=workflow%3A%22tests%22\n :alt: tests\n\n.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json\n :target: https://github.com/astral-sh/ruff\n :alt: Ruff\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/psf/black\n :alt: Code style: Black\n\n.. image:: https://readthedocs.org/projects/cherrypy-cors/badge/?version=latest\n :target: https://cherrypy-cors.readthedocs.io/en/latest/?badge=latest\n\n.. image:: https://img.shields.io/badge/skeleton-2023-informational\n :target: https://blog.jaraco.com/skeleton\n\nCORS support for CherryPy\n\nIn a nutshell\n=============\n\nIn your application, either install the tool globally.\n\n.. code-block:: python\n\n import cherrypy_cors\n cherrypy_cors.install()\n\nOr add it to your application explicitly.\n\n.. code-block:: python\n\n import cherrypy_cors\n app = cherrypy.tree.mount(...)\n app.toolboxes['cors'] = cherrypy_cors.tools\n\nThen, enable it in your cherrypy config. For example, to enable it for all\nstatic resources.\n\n.. code-block:: python\n\n config = {\n '/static': {\n 'tools.staticdir.on': True,\n 'cors.expose.on': True,\n }\n }\n\nSee `simple-example\n<https://github.com/yougov/cherrypy-cors/blob/master/simple-example.py>`_\nfor a runnable example.\n",
"bugtrack_url": null,
"license": "",
"summary": "CORS handling as a cherrypy tool.",
"version": "1.7.0",
"project_urls": {
"Homepage": "https://github.com/cherrypy/cherrypy-cors"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d70501d4deda775d3a84d172719ebd1cb5314487377a128e892208b0a9533fc5",
"md5": "e298b862def5ba6d91e4c4799217b100",
"sha256": "9cdeddcad89efba5a7bed06ed80150ef7cc418899209e6507481e84be7df6eea"
},
"downloads": -1,
"filename": "cherrypy_cors-1.7.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e298b862def5ba6d91e4c4799217b100",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 5214,
"upload_time": "2023-08-28T02:12:10",
"upload_time_iso_8601": "2023-08-28T02:12:10.328207Z",
"url": "https://files.pythonhosted.org/packages/d7/05/01d4deda775d3a84d172719ebd1cb5314487377a128e892208b0a9533fc5/cherrypy_cors-1.7.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e0c3d62ce781e2e2be9c2d4c5670f0bff518dc1b00396e2ce135dbfdcd4f1b9d",
"md5": "bfa2c24aebf9fecb8a6163421aa708f9",
"sha256": "83384cd664a7ab8b9ab7d4926fe9713acfe0bce3665ee28189a0fa04b9f212d6"
},
"downloads": -1,
"filename": "cherrypy-cors-1.7.0.tar.gz",
"has_sig": false,
"md5_digest": "bfa2c24aebf9fecb8a6163421aa708f9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 10257,
"upload_time": "2023-08-28T02:12:11",
"upload_time_iso_8601": "2023-08-28T02:12:11.481681Z",
"url": "https://files.pythonhosted.org/packages/e0/c3/d62ce781e2e2be9c2d4c5670f0bff518dc1b00396e2ce135dbfdcd4f1b9d/cherrypy-cors-1.7.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-28 02:12:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cherrypy",
"github_project": "cherrypy-cors",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"tox": true,
"lcname": "cherrypy-cors"
}