Ravenports generated: 25 Nov 2019 17:36
[ravenports.git] / bucket_32 / python-Flask-Cors
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               python-Flask-Cors
4 VERSION=                3.0.8
5 KEYWORDS=               python devel
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]
12
13 DOWNLOAD_GROUPS=        main
14 SITES[main]=            PYPI/F/Flask-Cors
15 DISTFILE[1]=            Flask-Cors-3.0.8.tar.gz:main
16 DF_INDEX=               1
17 SPKGS[py37]=            single
18 SPKGS[py38]=            single
19 SPKGS[py27]=            single
20
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
26
27 DISTNAME=               Flask-Cors-3.0.8
28
29 GENERATED=              yes
30
31 INVALID_RPATH=          yes
32
33 [PY37].BUILDRUN_DEPENDS_ON=             python-Flask:single:py37
34                                         python-six:single:py37
35 [PY37].USES_ON=                         python:py37
36
37 [PY38].BUILDRUN_DEPENDS_ON=             python-Flask:single:py38
38                                         python-six:single:py38
39 [PY38].USES_ON=                         python:py38
40
41 [PY27].BUILDRUN_DEPENDS_ON=             python-Flask:single:py27
42                                         python-six:single:py27
43 [PY27].USES_ON=                         python:py27
44
45 [FILE:3026:descriptions/desc.single]
46 Flask-CORS
47 ==========
48
49 |Build Status| |Latest Version| |Supported Python versions|
50 |License|
51
52 A Flask extension for handling Cross Origin Resource Sharing (CORS),
53 making cross-origin AJAX possible.
54
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!
63
64 Installation
65 ------------
66
67 Install the extension with using pip, or easy\_install.
68
69 .. code:: bash
70
71     $ pip install -U flask-cors
72
73 Usage
74 -----
75
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.
80
81 Simple Usage
82 ~~~~~~~~~~~~
83
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>`__.
88
89 .. code:: python
90
91
92     from flask import Flask
93     from flask_cors import CORS
94
95     app = Flask(__name__)
96     CORS(app)
97
98     @app.route("/")
99     def helloWorld():
100       return "Hello, cross-origin-world!"
101
102 Resource specific CORS
103 ^^^^^^^^^^^^^^^^^^^^^^
104
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>`__.
110
111 .. code:: python
112
113     app = Flask(__name__)
114     cors = CORS(app, resources={r"/api/*": {"origins": "*"}})
115
116     @app.route("/api/v1/users")
117     def list_users():
118       return "user example"
119
120 Route specific CORS via decorator
121 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
122
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>`__.
128
129 .. code:: python
130
131     @app.route("/")
132     @cross_origin()
133     def helloWorld():
134       return "Hello, cross-origin-world!"
135
136 Documentation
137 -------------
138
139 For a full list of options, please see the full
140 `documentation <https://flask-cors.corydolphin.com/en/latest/api.html>`__
141
142 Troubleshooting
143 ---------------
144
145 If things aren't working as you expect, enable logging to help understand
146 what is going on under the hood, and why.
147
148 .. code:: python
149
150     logging.getLogger('flask_cors').level = logging.DEBUG
151
152
153
154 [FILE:102:distinfo]
155 72170423eb4612f0847318afff8c247b38bd516b7737adfc10d1c2cdbb382d16        27651 Flask-Cors-3.0.8.tar.gz
156