

If there’s a feature that hasn’t been merged, please open an issueĭjango-cors-headers has had 40+ contributors Merged back, or re-implemented in a different way, so it should be possible to In September 2016, Adam Johnson, Ed Morley, and others gained maintenanceīasically all of the changes in the forked django-cors-middleware were Unmaintained from August 2015 and was forked in January 2016 to the package Aboutĭjango-cors-headers was created in January 2013 by Otto Yiu.

To add the CORS headers to these responses.

Middleware that can generate responses such as Django’s CommonMiddleware or You will also need to add a middleware class to listen in on responses: MIDDLEWARE = ĬorsMiddleware should be placed as high as possible, especially before any Make sure you add the trailing comma or you might get a ModuleNotFoundError Install from pip: python -m pip install django-cors-headersĪnd then add it to your installed apps: INSTALLED_APPS = Some good resources to read on the subject are:Ĭheck out my book Boost Your Django DX which covers many ways to improve your development experience. Important you understand the implications before adding the headers, since youĬould be unintentionally opening up your site’s private data to others. This allows in-browser requests to your Django application fromĪdding CORS headers allows your resources to be accessed on other domains. A Django App that adds Cross-Origin Resource Sharing (CORS) headers to
