1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-Flask-Cors
7 SDESC[py37]= Cross Origin Resource Sharing extension (PY 37)
8 SDESC[py38]= Cross Origin Resource Sharing extension (PY 38)
9 HOMEPAGE= https://github.com/corydolphin/flask-cors
10 CONTACT= Python_Automaton[python@ironwolf.systems]
13 SITES[main]= PYPI/F/Flask-Cors
14 DISTFILE[1]= Flask-Cors-3.0.8.tar.gz:main
19 OPTIONS_AVAILABLE= PY38 PY37
20 OPTIONS_STANDARD= none
21 VOPTS[py37]= PY38=OFF PY37=ON
22 VOPTS[py38]= PY38=ON PY37=OFF
24 DISTNAME= Flask-Cors-3.0.8
28 [PY37].BUILDRUN_DEPENDS_ON= python-Flask:single:py37
29 python-six:single:py37
30 [PY37].USES_ON= python:py37
32 [PY38].BUILDRUN_DEPENDS_ON= python-Flask:single:py38
33 python-six:single:py38
34 [PY38].USES_ON= python:py38
36 [FILE:3026:descriptions/desc.single]
40 |Build Status| |Latest Version| |Supported Python versions|
43 A Flask extension for handling Cross Origin Resource Sharing (CORS),
44 making cross-origin AJAX possible.
46 This package has a simple philosophy, when you want to enable CORS, you
47 wish to enable it for all use cases on a domain. This means no mucking
48 around with different allowed headers, methods, etc. By default,
49 submission of cookies across domains is disabled due to the security
50 implications, please see the documentation for how to enable
51 credential'ed requests, and please make sure you add some sort of
52 `CSRF <http://en.wikipedia.org/wiki/Cross-site_request_forgery>`__
53 protection before doing so!
58 Install the extension with using pip, or easy\_install.
62 $ pip install -U flask-cors
67 This package exposes a Flask extension which by default enables CORS
68 support on all routes, for all origins and methods. It allows
69 parameterization of all CORS headers on a per-resource level. The package
70 also contains a decorator, for those who prefer this approach.
75 In the simplest case, initialize the Flask-Cors extension with default
76 arguments in order to allow CORS for all domains on all routes. See the
77 full list of options in the `documentation
78 <https://flask-cors.corydolphin.com/en/latest/api.html#extension>`__.
83 from flask import Flask
84 from flask_cors import CORS
91 return "Hello, cross-origin-world!"
93 Resource specific CORS
94 ^^^^^^^^^^^^^^^^^^^^^^
96 Alternatively, you can specify CORS options on a resource and origin
97 level of granularity by passing a dictionary as the `resources` option,
98 mapping paths to a set of options. See the
99 full list of options in the `documentation
100 <https://flask-cors.corydolphin.com/en/latest/api.html#extension>`__.
104 app = Flask(__name__)
105 cors = CORS(app, resources={r"/api/*": {"origins": "*"}})
107 @app.route("/api/v1/users")
109 return "user example"
111 Route specific CORS via decorator
112 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
114 This extension also exposes a simple decorator to decorate flask routes
115 with. Simply add ``@cross_origin()`` below a call to Flask's
116 ``@app.route(..)`` to allow CORS on a given route. See the
117 full list of options in the `decorator documentation
118 <https://flask-cors.corydolphin.com/en/latest/api.html#decorator>`__.
125 return "Hello, cross-origin-world!"
130 For a full list of options, please see the full
131 `documentation <https://flask-cors.corydolphin.com/en/latest/api.html>`__
136 If things aren't working as you expect, enable logging to help understand
137 what is going on under the hood, and why.
141 logging.getLogger('flask_cors').level = logging.DEBUG
146 72170423eb4612f0847318afff8c247b38bd516b7737adfc10d1c2cdbb382d16 27651 Flask-Cors-3.0.8.tar.gz