Oleg2016-02-03 19:16:31
Oleg, 2016-02-03 19:16:31

Angularjs + Django REST Framework - how to pass CSRF?

For educational purposes, I am writing a web application in conjunction with AngularJS + Django using the REST Framework. Quite new to Django and Python.
The frontend and backend are running on the local machine on different ports.
When I try to log in as superuser through an AngularJS form, I get a 403 response, the essence of which is:

CSRF cookie not set.

Google suggested that I need to add the @ensure_csrf_cookie decorator somewhere in the REST framework settings, but where exactly should I put it is still a mystery to me.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Abdulla Mursalov, 2016-02-03


Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question