Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

248
Views
How to use a prop from an auth route to gain props from a different route? (Django/React)

I'm creating a profile page with Django and react. The idea is that once a user is signed in, they go to a profile page and it sends a get request to http://localhost:8000/users/auth/user and then uses the props to populate the page. However, since this is a Django-created route, I need to use maybe data.username to link a different route that displays all the other props i need (such as bio, location) and then populate the rest of the profile with this.

Here is an example of the code:

fetch('http://localhost:8000/users/auth/users', {
          method: 'GET',
          headers: {
            'Content-Type': 'application/json',
            Authorization: `Token ${localStorage.getItem('token')}`
          }
        })
.then(data => {
              console.log(data)
            setUserName(data.username);

And somehow use data.username to fetch another route that displays my other props not located in auth.

How can I do this within the fetch/then format? Please let me know if further clarification is needed. Thank you!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!