0

I made a system to help the company with a task work, and hopefully, be noticed to work with the development team.

One of the things that's mandatory for my project is its compatibility for mobile devices. The backend was made using Django, and I've created a API with the Django rest framework. I have tried to develop a React Native app that uses the API, but every time I try to use it I get the 401 error from Django/the API, and I can't find the mistake. What is the fix to this issue?

Thanks, Pedro

New contributor
Pedrin_Dev is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
8
  • 1
    Hello, and welcome to Stack Overflow. May you please share me what api is causing the error, its code, and what authentication system it uses? Commented yesterday
  • Sure mate, thank you for helping me, I have used the import Classes from django rest framework (ListCreateAPIView and RetrieveUpdateAPIView), and overwrote the permission_classes with the ( IsAuthenticated ) class from djangorestframework permissions. Also, worth mentioning, I tried to use the api on postman, It worked totally fine, so the bug might be on the React code. Commented yesterday
  • Are you using the default Django Rest Framework token system, with the token class? And also, what is your exact 401 error, cause these sorts of errors (works in Postman, fails in RN) happen often. Commented yesterday
  • Yeah, the Django Rest Framework, 401(credentials were not provided) the system is not receiving the token to access the APIView Commented yesterday
  • Please provide enough code so others can better understand or reproduce the problem. Commented yesterday

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.