Skip to main content

A Django app enabling cross-origin resource sharing in views.

Project description

django-cross-origin is a Django app enabling cross-origin resource sharing in views.

Features

  • Enable CORS on Django class-based generic views with a simple mixin.

  • Full customization of all CORS headers via accessor override.

Installation

  1. Checkout the latest django-cross-origin release and copy or symlink the cross_origin directory into your PYTHONPATH. If using pip, run pip install django-cross-origin.

  2. Add 'cross_origin' to your INSTALLED_APPS setting.

Usage

To enable CORS on a Django class-based view, simply mixin the cross_origin.views.AccessControlMixin to your view:

from django.views import generic
from cross_origin.views import AccessControlMixin

class YourView(AccessControlMixin, generic.TemplateView):

    """Your view code here!"""

All CORS response headers can be customized by overriding accessor methods on your view. For a complete list of available accessors, see the source code for AccessControlMixin.

More information

The django-cross-origin project was developed at Mohawk, and is released as Open Source under the MIT license.

You can get the code from the django-cross-origin project site.

Contributors

The following people were involved in the development of this project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-cross-origin-0.9.0.tar.gz (4.0 kB view details)

Uploaded Source

File details

Details for the file django-cross-origin-0.9.0.tar.gz.

File metadata

File hashes

Hashes for django-cross-origin-0.9.0.tar.gz
Algorithm Hash digest
SHA256 1a4beb3b514da787bc424937bc18918f7e2fe8c80b26c4da194d809bb4f06fcc
MD5 989605a1313bc501b20057007f3bd3cc
BLAKE2b-256 f37ffb4d9985a44fae37f72720c764387991fe5011d5275fcf876416249429b6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page