These are chat archives for django/django

7th
Jul 2017
santhoshyuvi
@santhoshyuvi
Jul 07 2017 07:02
hello
i want to know how to convert a csv file into json format(all the content of my csv file into json format)in rest api django
pls help me to get over
neel12345
@neel12345
Jul 07 2017 08:11
Hello. Have an issue with django rest APIs. Im doing a patch and it works perfectly fine via chrome but not via safari. Here is the error : raise ValueError(errmsg("Expecting value", s, err.value)) from None\nValueError: Expecting value: line 1 column 1 (char 0)\n'}
All help appreciated.
Sean Parsons
@seanpar203
Jul 07 2017 14:29
@santhoshyuvi If you want read from a CSV use the csv package from the builtin module and use the reader, then use the json module to convert python data into a json via json_data = json.dumps(python_dict)
@santhoshyuvi Either that or use something pandas if you need to do some manipulations on the data before marshaling the data.