S
S
s1vemod2021-02-20 13:40:06
Django
s1vemod, 2021-02-20 13:40:06

How to set up React-only API?

Good afternoon.

I am writing my own Django-React application. React makes requests - Django returns information. It seems to be simple.

But I want only React and only React to be able to make API requests. Read about Token/rest_framework.authentication.

But all examples come down to logging in the user and creating a Token for him.

How do I create a Token, just for a React app, and then secure the View?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2021-02-20
@s1vemod

It is impossible to protect the backend - one way or another you give the client application all the necessary data to send requests, and if a person really needs it, he can easily repeat any scheme.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question