Ravenports generated: 26 Nov 2019 23:39
[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 [PY37].BUILDRUN_DEPENDS_ON=             python-Flask:single:py37
32                                         python-six:single:py37
33 [PY37].USES_ON=                         python:py37
34
35 [PY38].BUILDRUN_DEPENDS_ON=             python-Flask:single:py38
36                                         python-six:single:py38
37 [PY38].USES_ON=                         python:py38
38
39 [PY27].BUILDRUN_DEPENDS_ON=             python-Flask:single:py27
40                                         python-six:single:py27
41 [PY27].USES_ON=                         python:py27
42
43 [FILE:3026:descriptions/desc.single]
44 Flask-CORS
45 ==========
46
47 |Build Status| |Latest Version| |Supported Python versions|
48 |License|
49
50 A Flask extension for handling Cross Origin Resource Sharing (CORS),
51 making cross-origin AJAX possible.
52
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!
61
62 Installation
63 ------------
64
65 Install the extension with using pip, or easy\_install.
66
67 .. code:: bash
68
69     $ pip install -U flask-cors
70
71 Usage
72 -----
73
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.
78
79 Simple Usage
80 ~~~~~~~~~~~~
81
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>`__.
86
87 .. code:: python
88
89
90     from flask import Flask
91     from flask_cors import CORS
92
93     app = Flask(__name__)
94     CORS(app)
95
96     @app.route("/")
97     def helloWorld():
98       return "Hello, cross-origin-world!"
99
100 Resource specific CORS
101 ^^^^^^^^^^^^^^^^^^^^^^
102
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>`__.
108
109 .. code:: python
110
111     app = Flask(__name__)
112     cors = CORS(app, resources={r"/api/*": {"origins": "*"}})
113
114     @app.route("/api/v1/users")
115     def list_users():
116       return "user example"
117
118 Route specific CORS via decorator
119 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
120
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>`__.
126
127 .. code:: python
128
129     @app.route("/")
130     @cross_origin()
131     def helloWorld():
132       return "Hello, cross-origin-world!"
133
134 Documentation
135 -------------
136
137 For a full list of options, please see the full
138 `documentation <https://flask-cors.corydolphin.com/en/latest/api.html>`__
139
140 Troubleshooting
141 ---------------
142
143 If things aren't working as you expect, enable logging to help understand
144 what is going on under the hood, and why.
145
146 .. code:: python
147
148     logging.getLogger('flask_cors').level = logging.DEBUG
149
150
151
152 [FILE:102:distinfo]
153 72170423eb4612f0847318afff8c247b38bd516b7737adfc10d1c2cdbb382d16        27651 Flask-Cors-3.0.8.tar.gz
154