I am trying to attach my Angular front end to my Django backend. To do this I have created my own source of session control. I have added this to my view...
from django.views.decorators.csrf import csrf_exempt
@require_POST
@csrf_exempt
def my_view_function(request):
# do something
I have this code on my actual server, and I am hosting Angular locally. When I submit a request I get this error in the google chrome console:
Access to XMLHttpRequest at 'https://fake_real_url/signin/checkemail/' from origin 'https://localhost:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
And the apache server log says
Forbidden (CSRF cookie not set.): /signin/checkemail/
I thought that csrf_exempt would fix this issue? Am I missing something?