1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-Flask-Cors
6 VARIANTS= py27 py36 py37
7 SDESC[py36]= Cross Origin Resource Sharing extension (PY 36)
8 SDESC[py37]= Cross Origin Resource Sharing extension (PY 37)
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.6.tar.gz:main
21 OPTIONS_AVAILABLE= PY27 PY36 PY37
22 OPTIONS_STANDARD= none
23 VOPTS[py36]= PY27=OFF PY36=ON PY37=OFF
24 VOPTS[py37]= PY27=OFF PY36=OFF PY37=ON
25 VOPTS[py27]= PY27=ON PY36=OFF PY37=OFF
27 DISTNAME= Flask-Cors-3.0.6
31 [PY36].BUILDRUN_DEPENDS_ON= python-Flask:single:py36
32 python-six:single:py36
33 [PY36].USES_ON= python:py36
35 [PY37].BUILDRUN_DEPENDS_ON= python-Flask:single:py37
36 python-six:single:py37
37 [PY37].USES_ON= python:py37
39 [PY27].BUILDRUN_DEPENDS_ON= python-Flask:single:py27
40 python-six:single:py27
41 [PY27].USES_ON= python:py27
43 [FILE:3026:descriptions/desc.single]
47 |Build Status| |Latest Version| |Supported Python versions|
50 A Flask extension for handling Cross Origin Resource Sharing (CORS),
51 making cross-origin AJAX possible.
53 This package has a simple philosophy, when you want to enable CORS, you
54 wish to enable it for all use cases on a domain. This means no mucking
55 around with different allowed headers, methods, etc. By default,
56 submission of cookies across domains is disabled due to the security
57 implications, please see the documentation for how to enable
58 credential'ed requests, and please make sure you add some sort of
59 `CSRF <http://en.wikipedia.org/wiki/Cross-site_request_forgery>`__
60 protection before doing so!
65 Install the extension with using pip, or easy\_install.
69 $ pip install -U flask-cors
74 This package exposes a Flask extension which by default enables CORS
75 support on all routes, for all origins and methods. It allows
76 parameterization of all CORS headers on a per-resource level. The package
77 also contains a decorator, for those who prefer this approach.
82 In the simplest case, initialize the Flask-Cors extension with default
83 arguments in order to allow CORS for all domains on all routes. See the
84 full list of options in the `documentation
85 <https://flask-cors.corydolphin.com/en/latest/api.html#extension>`__.
90 from flask import Flask
91 from flask_cors import CORS
98 return "Hello, cross-origin-world!"
100 Resource specific CORS
101 ^^^^^^^^^^^^^^^^^^^^^^
103 Alternatively, you can specify CORS options on a resource and origin
104 level of granularity by passing a dictionary as the `resources` option,
105 mapping paths to a set of options. See the
106 full list of options in the `documentation
107 <https://flask-cors.corydolphin.com/en/latest/api.html#extension>`__.
111 app = Flask(__name__)
112 cors = CORS(app, resources={r"/api/*": {"origins": "*"}})
114 @app.route("/api/v1/users")
116 return "user example"
118 Route specific CORS via decorator
119 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
121 This extension also exposes a simple decorator to decorate flask routes
122 with. Simply add ``@cross_origin()`` below a call to Flask's
123 ``@app.route(..)`` to allow CORS on a given route. See the
124 full list of options in the `decorator documentation
125 <https://flask-cors.corydolphin.com/en/latest/api.html#decorator>`__.
132 return "Hello, cross-origin-world!"
137 For a full list of options, please see the full
138 `documentation <https://flask-cors.corydolphin.com/en/latest/api.html>`__
143 If things aren't working as you expect, enable logging to help understand
144 what is going on under the hood, and why.
148 logging.getLogger('flask_cors').level = logging.DEBUG
153 ecc016c5b32fa5da813ec8d272941cfddf5f6bba9060c405a70285415cbf24c9 28390 Flask-Cors-3.0.6.tar.gz