Ravenports generated: 05 Jan 2020 23:53
[ravenports.git] / bucket_86 / python-django-cors-headers
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               python-django-cors-headers
4 VERSION=                3.2.1
5 KEYWORDS=               python devel
6 VARIANTS=               py38 py37
7 SDESC[py37]=            Django handler for CORS server headers (PY 37)
8 SDESC[py38]=            Django handler for CORS server headers (PY 38)
9 HOMEPAGE=               https://github.com/adamchainz/django-cors-headers
10 CONTACT=                Python_Automaton[python@ironwolf.systems]
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            PYPI/d/django-cors-headers
14 DISTFILE[1]=            django-cors-headers-3.2.1.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=               django-cors-headers-3.2.1
25
26 GENERATED=              yes
27
28 [PY37].USES_ON=                         python:py37
29
30 [PY38].USES_ON=                         python:py38
31
32 [FILE:3317:descriptions/desc.single]
33 django-cors-headers
34 ===================
35
36 .. image::
37 https://travis-ci.org/adamchainz/django-cors-headers.svg?branch=master
38    :target: https://travis-ci.org/adamchainz/django-cors-headers
39
40 .. image:: https://img.shields.io/pypi/v/django-cors-headers.svg
41     :target: https://pypi.python.org/pypi/django-cors-headers/
42
43 .. image:: https://img.shields.io/badge/code%20style-black-000000.svg
44     :target: https://github.com/python/black
45
46 A Django App that adds Cross-Origin Resource Sharing (CORS) headers to
47 responses. This allows in-browser requests to your Django application from
48 other origins.
49
50 About CORS
51 ----------
52
53 Adding CORS headers allows your resources to be accessed on other domains.
54 It's
55 important you understand the implications before adding the headers, since
56 you
57 could be unintentionally opening up your site's private data to others.
58
59 Some good resources to read on the subject are:
60
61 * The `Wikipedia Page
62 <https://en.m.wikipedia.org/wiki/Cross-origin_resource_sharing>`_
63 * The `MDN Article
64 <https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS>`_
65 * The `HTML5 Rocks Tutorial
66 <https://www.html5rocks.com/en/tutorials/cors/>`_
67
68 Requirements
69 ------------
70
71 Python 3.5 to 3.8 supported.
72
73 Django 1.11 to 3.0 suppported.
74
75 Setup
76 -----
77
78 Install from **pip**:
79
80 .. code-block:: sh
81
82     pip install django-cors-headers
83
84 and then add it to your installed apps:
85
86 .. code-block:: python
87
88     INSTALLED_APPS = [
89         ...
90         'corsheaders',
91         ...
92     ]
93
94 You will also need to add a middleware class to listen in on responses:
95
96 .. code-block:: python
97
98     MIDDLEWARE = [  # Or MIDDLEWARE_CLASSES on Django < 1.10
99         ...
100         'corsheaders.middleware.CorsMiddleware',
101         'django.middleware.common.CommonMiddleware',
102         ...
103     ]
104
105 ``CorsMiddleware`` should be placed as high as possible, especially before
106 any
107 middleware that can generate responses such as Django's
108 ``CommonMiddleware`` or
109 Whitenoise's ``WhiteNoiseMiddleware``. If it is not before, it will not be
110 able
111 to add the CORS headers to these responses.
112
113 Also if you are using ``CORS_REPLACE_HTTPS_REFERER`` it should be placed
114 before
115 Django's ``CsrfViewMiddleware`` (see more below).
116
117 About
118 -----
119
120 **django-cors-headers** was created in January 2013 by Otto Yiu. It went
121 unmaintained from August 2015 and was forked in January 2016 to the package
122 `django-cors-middleware
123 <https://github.com/zestedesavoir/django-cors-middleware>`_
124 by Laville Augustin at Zeste de Savoir.
125 In September 2016, Adam Johnson, Ed Morley, and others gained maintenance
126 responsibility for **django-cors-headers**
127 (`Issue 110
128 <https://github.com/adamchainz/django-cors-headers/issues/110>`__)
129 from Otto Yiu.
130 Basically all of the changes in the forked **django-cors-middleware** were
131 merged back, or re-implemented in a different way, so it should be
132 possible to
133 switch back. If there's a feature that hasn't been merged, please open an
134 issue
135 about it.
136
137 **django-cors-headers** has had `40+ contributors
138 <https://github.com/adamchainz/django-cors-headers/graphs/contributors>`__
139 in its time; thanks to every one of them.
140
141 Configuration
142 -------------
143
144 Configure the middleware's behaviour in your Django settings. You must add
145 the
146 hosts that are allowed to do cross-site requests to
147 ``CORS_ORIGIN_WHITELIST``, or set ``CORS_ORIGIN_ALLOW_ALL`` to ``True``
148
149
150 [FILE:111:distinfo]
151 a5960addecc04527ab26617e51b8ed42f0adab4594b24bb0f3c33e2bd3857c3f        26261 django-cors-headers-3.2.1.tar.gz
152