Hercules: csrf frees django rest framework

I have the following view:

@api_view(POST?) @csrf_exempt def user_login(request): 

which adheres to the django rest framework.

How can I free this kind of csrf?

I am trying to make API calls via iphone.

+4
source share
1 answer

This forum post seems to help clarify.

https://groups.google.com/forum/?fromgroups=#!topic/django-rest-framework/JCf4MwNtfwM

In accordance with this

 "REST framework views are CSRF exempt by default unless your using UserLoggedInAuthentication" 

Are you actively facing CSRF security with the REST Framework?

Joe

+2
source

Source: https://habr.com/ru/post/1480172/


All Articles