I've written a python script on my raspberry pi. I want to send it to my django view function, but I keep running into csrf token issues. I've read about the work around using the decorator, but I want to know if there is a more clean way in sending data to a django view.
Asked
Active
Viewed 150 times
1
-
You can use APIView, the csrf issue will be resolved – shoytov Apr 06 '20 at 13:48
-
So by making my backend a django rest framework would help resolve this issus ? – RocketBug Apr 06 '20 at 13:53
-
I mean Yes. alternative: https://stackoverflow.com/questions/16458166/how-to-disable-djangos-csrf-validation – shoytov Apr 06 '20 at 13:59
-
I have tried what you suggest, I was looking for something with more security and not working around the csrf token. – RocketBug Apr 06 '20 at 14:05
-
Take a look at this question: https://security.stackexchange.com/questions/115766/is-a-jwt-usable-as-a-csrf-token – schillingt Apr 06 '20 at 14:26