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

307
Views
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 answers
Answer question

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 Report
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!