Ravenports generated: 04 Dec 2019 22:38
[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=               py38 py37
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]
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            PYPI/F/Flask-Cors
14 DISTFILE[1]=            Flask-Cors-3.0.8.tar.gz:main
15 DF_INDEX=               1
16 SPKGS[py37]=            single
17 SPKGS[py38]=            single
18
19 OPTIONS_AVAILABLE=      PY38 PY37
20 OPTIONS_STANDARD=       none
21 VOPTS[py37]=            PY38=OFF PY37=ON
22 VOPTS[py38]=            PY38=ON PY37=OFF
23
24 DISTNAME=               Flask-Cors-3.0.8
25
26 GENERATED=              yes
27
28 [PY37].BUILDRUN_DEPENDS_ON=             python-Flask:single:py37
29                                         python-six:single:py37
30 [PY37].USES_ON=                         python:py37
31
32 [PY38].BUILDRUN_DEPENDS_ON=             python-Flask:single:py38
33                                         python-six:single:py38
34 [PY38].USES_ON=                         python:py38
35
36 [FILE:3026:descriptions/desc.single]
37 Flask-CORS
38 ==========
39
40 |Build Status| |Latest Version| |Supported Python versions|
41 |License|
42
43 A Flask extension for handling Cross Origin Resource Sharing (CORS),
44 making cross-origin AJAX possible.
45
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!
54
55 Installation
56 ------------
57
58 Install the extension with using pip, or easy\_install.
59
60 .. code:: bash
61
62     $ pip install -U flask-cors
63
64 Usage
65 -----
66
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.
71
72 Simple Usage
73 ~~~~~~~~~~~~
74
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>`__.
79
80 .. code:: python
81
82
83     from flask import Flask
84     from flask_cors import CORS
85
86     app = Flask(__name__)
87     CORS(app)
88
89     @app.route("/")
90     def helloWorld():
91       return "Hello, cross-origin-world!"
92
93 Resource specific CORS
94 ^^^^^^^^^^^^^^^^^^^^^^
95
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>`__.
101
102 .. code:: python
103
104     app = Flask(__name__)
105     cors = CORS(app, resources={r"/api/*": {"origins": "*"}})
106
107     @app.route("/api/v1/users")
108     def list_users():
109       return "user example"
110
111 Route specific CORS via decorator
112 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
113
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>`__.
119
120 .. code:: python
121
122     @app.route("/")
123     @cross_origin()
124     def helloWorld():
125       return "Hello, cross-origin-world!"
126
127 Documentation
128 -------------
129
130 For a full list of options, please see the full
131 `documentation <https://flask-cors.corydolphin.com/en/latest/api.html>`__
132
133 Troubleshooting
134 ---------------
135
136 If things aren't working as you expect, enable logging to help understand
137 what is going on under the hood, and why.
138
139 .. code:: python
140
141     logging.getLogger('flask_cors').level = logging.DEBUG
142
143
144
145 [FILE:102:distinfo]
146 72170423eb4612f0847318afff8c247b38bd516b7737adfc10d1c2cdbb382d16        27651 Flask-Cors-3.0.8.tar.gz
147