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

155
Views
format issue when saving captured data with request.POST

The data is being captured, however when saving to the database it is being saved with quotes and square brackets.

def create_flow_and_phases(request):


    data = {
        "name": request.POST['new_flow_name'],
        "description": request.POST['flow_description'],
        "category": request.POST['select_category'],
        "precedents": [request.POST['precedent_list']],
        "users": [1],
        "phases": ''
    }

    # Making a POST request to save flow_and_phases
    url = API_HOST + "/api/flows/save_flow_and_phases/"

    answer = requests.post(url, data=data, headers={'Authorization': 'Token ' + request.session['user_token']})

    if not answer.ok:
        raise Exception("An error occurred while creating flow.")

Example of data in DB: Name: ['test']

I'm using Django Framework

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I needed to pass the data dictionary as a JSON and it worked

answer = requests.post(url, json=data, headers={'Authorization': 'Token ' + request.session['user_token']})
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!