1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-django-cors-headers
7 SDESC[py37]= Django handler for CORS server headers (PY37)
8 SDESC[py38]= Django handler for CORS server headers (PY38)
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.5.0.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.5.0
28 [PY37].BUILDRUN_DEPENDS_ON= python-Django:single:py37
29 [PY37].USES_ON= python:py37
31 [PY38].BUILDRUN_DEPENDS_ON= python-Django:single:py38
32 [PY38].USES_ON= python:py38
34 [FILE:2586:descriptions/desc.single]
38 A Django App that adds Cross-Origin Resource Sharing (CORS) headers to
39 responses. This allows in-browser requests to your Django application from
45 Adding CORS headers allows your resources to be accessed on other domains.
47 important you understand the implications before adding the headers, since
49 could be unintentionally opening up your site's private data to others.
51 Some good resources to read on the subject are:
53 * Julia Evans' [introductory comic]
54 * The [Wikipedia Page]
56 * The [HTML5 Rocks Tutorial]
61 Python 3.5 to 3.8 supported.
63 Django 2.2 to 3.0 supported.
67 **Are your tests slow?**
68 Check out my book [Speed Up Your Django Tests] which covers loads of best
69 practices so you can write faster, more accurate tests.
80 python -m pip install django-cors-headers
82 and then add it to your installed apps:
84 .. code-block:: python
92 Make sure you add the trailing comma or you might get a ModuleNotFoundError
96 You will also need to add a middleware class to listen in on responses:
98 .. code-block:: python
102 'corsheaders.middleware.CorsMiddleware',
103 'django.middleware.common.CommonMiddleware',
107 CorsMiddleware should be placed as high as possible, especially before any
108 middleware that can generate responses such as Django's CommonMiddleware or
109 Whitenoise's WhiteNoiseMiddleware. If it is not before, it will not be able
110 to add the CORS headers to these responses.
112 Also if you are using CORS_REPLACE_HTTPS_REFERER it should be placed before
113 Django's CsrfViewMiddleware (see more below).
118 **django-cors-headers** was created in January 2013 by Otto Yiu. It went
119 unmaintained from August 2015 and was forked in January 2016 to the package
120 `django-cors-middleware
121 <https://github.com/zestedesavoir/django-cors-middleware>`_
122 by Laville Augustin at Zeste de Savoir.
123 In September 2016, Adam Johnson, Ed Morley, and others gained maintenance
124 responsibility for **django-cors-headers**
127 Basically all of the changes in the forked **django-cors-middleware** were
128 merged back, or re-implemented in a different way, so it should be possible
130 switch back. If there's a feature that hasn't been merged, please open an
134 **django-cors-headers** has had `40+ contributors
138 db82b2840f667d47872ae3e4a4e0a0d72fbecb42779b8aa233fa8bb965f7836a 82619 django-cors-headers-3.5.0.tar.gz