1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-Flask-Cors
6 VARIANTS= py27 py38 py37
7 SDESC[py37]= Cross Origin Resource Sharing extension (PY 37)
8 SDESC[py38]= Cross Origin Resource Sharing extension (PY 38)
9 SDESC[py27]= Cross Origin Resource Sharing extension (PY 27)
10 HOMEPAGE= https://github.com/corydolphin/flask-cors
11 CONTACT= Python_Automaton[python@ironwolf.systems]
14 SITES[main]= PYPI/F/Flask-Cors
15 DISTFILE[1]= Flask-Cors-3.0.8.tar.gz:main
21 OPTIONS_AVAILABLE= PY27 PY38 PY37
22 OPTIONS_STANDARD= none
23 VOPTS[py37]= PY27=OFF PY38=OFF PY37=ON
24 VOPTS[py38]= PY27=OFF PY38=ON PY37=OFF
25 VOPTS[py27]= PY27=ON PY38=OFF PY37=OFF
27 DISTNAME= Flask-Cors-3.0.8
33 [PY37].BUILDRUN_DEPENDS_ON= python-Flask:single:py37
34 python-six:single:py37
35 [PY37].USES_ON= python:py37
37 [PY38].BUILDRUN_DEPENDS_ON= python-Flask:single:py38
38 python-six:single:py38
39 [PY38].USES_ON= python:py38
41 [PY27].BUILDRUN_DEPENDS_ON= python-Flask:single:py27
42 python-six:single:py27
43 [PY27].USES_ON= python:py27
45 [FILE:3026:descriptions/desc.single]
49 |Build Status| |Latest Version| |Supported Python versions|
52 A Flask extension for handling Cross Origin Resource Sharing (CORS),
53 making cross-origin AJAX possible.
55 This package has a simple philosophy, when you want to enable CORS, you
56 wish to enable it for all use cases on a domain. This means no mucking
57 around with different allowed headers, methods, etc. By default,
58 submission of cookies across domains is disabled due to the security
59 implications, please see the documentation for how to enable
60 credential'ed requests, and please make sure you add some sort of
61 `CSRF <http://en.wikipedia.org/wiki/Cross-site_request_forgery>`__
62 protection before doing so!
67 Install the extension with using pip, or easy\_install.
71 $ pip install -U flask-cors
76 This package exposes a Flask extension which by default enables CORS
77 support on all routes, for all origins and methods. It allows
78 parameterization of all CORS headers on a per-resource level. The package
79 also contains a decorator, for those who prefer this approach.
84 In the simplest case, initialize the Flask-Cors extension with default
85 arguments in order to allow CORS for all domains on all routes. See the
86 full list of options in the `documentation
87 <https://flask-cors.corydolphin.com/en/latest/api.html#extension>`__.
92 from flask import Flask
93 from flask_cors import CORS
100 return "Hello, cross-origin-world!"
102 Resource specific CORS
103 ^^^^^^^^^^^^^^^^^^^^^^
105 Alternatively, you can specify CORS options on a resource and origin
106 level of granularity by passing a dictionary as the `resources` option,
107 mapping paths to a set of options. See the
108 full list of options in the `documentation
109 <https://flask-cors.corydolphin.com/en/latest/api.html#extension>`__.
113 app = Flask(__name__)
114 cors = CORS(app, resources={r"/api/*": {"origins": "*"}})
116 @app.route("/api/v1/users")
118 return "user example"
120 Route specific CORS via decorator
121 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
123 This extension also exposes a simple decorator to decorate flask routes
124 with. Simply add ``@cross_origin()`` below a call to Flask's
125 ``@app.route(..)`` to allow CORS on a given route. See the
126 full list of options in the `decorator documentation
127 <https://flask-cors.corydolphin.com/en/latest/api.html#decorator>`__.
134 return "Hello, cross-origin-world!"
139 For a full list of options, please see the full
140 `documentation <https://flask-cors.corydolphin.com/en/latest/api.html>`__
145 If things aren't working as you expect, enable logging to help understand
146 what is going on under the hood, and why.
150 logging.getLogger('flask_cors').level = logging.DEBUG
155 72170423eb4612f0847318afff8c247b38bd516b7737adfc10d1c2cdbb382d16 27651 Flask-Cors-3.0.8.tar.gz