Send csrf token and retrieve with javascript?

2020-09-30 Thread Alexandro Gonçalves Dos Santos
I am building a django api to be used in a front end of another server, how do I send the csrf token and how do I retrieve it in the front end with javascript? Currently my posts.py file looks like this: ```python from django.http import HttpResponse from django.views.decorators.csrf import ensu

[API] Send csrf token and retrieve with javascript?

2020-09-30 Thread Alexandro Gonçalves Dos Santos
I am building a django api to be used in a front end of another server, how do I send the csrf token and how do I retrieve it in the front end with javascript? Currently my posts.py file looks like this: ```python from django.http import HttpResponse from django.views.decorators.csrf import ensu