1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-django-cors-headers
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]
13 SITES[main]= PYPI/d/django-cors-headers
14 DISTFILE[1]= django-cors-headers-3.2.1.tar.gz:main
19 OPTIONS_AVAILABLE= PY38 PY37
20 OPTIONS_STANDARD= none
21 VOPTS[py37]= PY38=OFF PY37=ON
22 VOPTS[py38]= PY38=ON PY37=OFF
24 DISTNAME= django-cors-headers-3.2.1
28 [PY37].USES_ON= python:py37
30 [PY38].USES_ON= python:py38
32 [FILE:3317:descriptions/desc.single]
37 https://travis-ci.org/adamchainz/django-cors-headers.svg?branch=master
38 :target: https://travis-ci.org/adamchainz/django-cors-headers
40 .. image:: https://img.shields.io/pypi/v/django-cors-headers.svg
41 :target: https://pypi.python.org/pypi/django-cors-headers/
43 .. image:: https://img.shields.io/badge/code%20style-black-000000.svg
44 :target: https://github.com/python/black
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
53 Adding CORS headers allows your resources to be accessed on other domains.
55 important you understand the implications before adding the headers, since
57 could be unintentionally opening up your site's private data to others.
59 Some good resources to read on the subject are:
62 <https://en.m.wikipedia.org/wiki/Cross-origin_resource_sharing>`_
64 <https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS>`_
65 * The `HTML5 Rocks Tutorial
66 <https://www.html5rocks.com/en/tutorials/cors/>`_
71 Python 3.5 to 3.8 supported.
73 Django 1.11 to 3.0 suppported.
82 pip install django-cors-headers
84 and then add it to your installed apps:
86 .. code-block:: python
94 You will also need to add a middleware class to listen in on responses:
96 .. code-block:: python
98 MIDDLEWARE = [ # Or MIDDLEWARE_CLASSES on Django < 1.10
100 'corsheaders.middleware.CorsMiddleware',
101 'django.middleware.common.CommonMiddleware',
105 ``CorsMiddleware`` should be placed as high as possible, especially before
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
111 to add the CORS headers to these responses.
113 Also if you are using ``CORS_REPLACE_HTTPS_REFERER`` it should be placed
115 Django's ``CsrfViewMiddleware`` (see more below).
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**
128 <https://github.com/adamchainz/django-cors-headers/issues/110>`__)
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
133 switch back. If there's a feature that hasn't been merged, please open an
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.
144 Configure the middleware's behaviour in your Django settings. You must add
146 hosts that are allowed to do cross-site requests to
147 ``CORS_ORIGIN_WHITELIST``, or set ``CORS_ORIGIN_ALLOW_ALL`` to ``True``
151 a5960addecc04527ab26617e51b8ed42f0adab4594b24bb0f3c33e2bd3857c3f 26261 django-cors-headers-3.2.1.tar.gz