Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

253
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda