Skip to content

django middleware to add cors response headers without a proxy server

License

Notifications You must be signed in to change notification settings

BerryDaniel/cf_django_cors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cf_django_cors

django middleware to add cors response headers without a proxy server

Configuration

Add the following to the django settings

MIDDLEWARE_CLASSES = (
    'cf_django_cors.middleware.CorsMiddleware',
) + MIDDLEWARE_CLASSES

By default this will add the following "response" headers:

Access-Control-Allow-Headers:x-requested-with, Content-Type, origin, authorization, accept, client-security-token
Access-Control-Allow-Methods:DELETE, GET, OPTIONS, POST, PUT
Access-Control-Allow-Origin:*
Access-Control-Max-Age:1000

In order the adjust the headers, you will need to set the following OS environments:

  • ALLOW_ORIGIN (string)
  • ALLOW_HEADERS (string)
  • ALLOW_METHODS (string)
  • MAX_AGE (integer)

About

django middleware to add cors response headers without a proxy server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages