Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

311
Vistas
string indices must be integers, not str - django

I am trying to pass this into a post from front end but I keep on getting this error on this line and I cannot figure out why is that

{"isUpdated": true} passing this

in my django, I have these

    body_unicode = request.body.decode('utf-8')
    data = json.loads(body_unicode)

    if data['isUpdated'] is not False:
     # more codes

I keep on getting error on this if data['isUpdated'] is not False:

Can someone give me suggestions what is happening?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The string indices must be integers, not str error means that the data variable contains a string, and Python is complaining that it cannot use a string to access the characters contained in that string (data[0] would return the first character, data[1] would return the second character and so on, but what would data['isUpdated'] return?)

What does the request body contain? Just the text of the post, or a JSON object?

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda