Streamline process for React + DRF Session authentication

61 views
Skip to first unread message

Brian Soto

unread,
Feb 16, 2021, 2:41:01 PM2/16/21
to Django REST framework
Hi. 

Sorry if this topic has already been talked about before, but I'd like to express my support for a stream-lined way of using session authentication with React. 

What I mean is, if we want to develop react with npm start ,and not re-compile every minor change made, the code JS will run on a different port, and make CORS/CSRF varification incredibly difficult with django. Only once the react code is compied will the JS run with django on the same port, but re-compiling for every small front-end code change is hair-pulling. 

Here is one of the few work-arounds I've found, observe, it involves quite a few hoops to jump:

So what I want to propose is some kind of streamlined process for React + DRF for session authentication. I'm not knowledgeabe enough to suggest what that would be, but as is, the solution is almost silly. 

That's all, I mostly just wanted to bring this issue to the attention of the community. If it isn't already. 

Thanks! 
Reply all
Reply to author
Forward
0 new messages