I am newbie to django and using it as back end for an application that creates users. In front end the code for posting the user name is :
var xobj = new XM
Add following line in middleware classes
'corsheaders.middleware.CorsPostCsrfMiddleware'
so overall implementation would be:
INSTALLED_APPS = (
...
'corsheaders',
...
)
MIDDLEWARE_CLASSES = (
...
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'corsheaders.middleware.CorsPostCsrfMiddleware'
...
)
CORS_ORIGIN_ALLOW_ALL = True
check documentaion below for more info