Open
Description
I run this through a terminal:
curl -X POST -d @C://Users/johnecon/Downloads/participants.csv -H "Authorization: Token b6b904232cb4abb86ba3e01e299110df9d4c83a4" -H "Content-Type: text/csv" localhost:8000/api/config
This is my view in listening in api/config
from rest_framework.decorators import api_view, authentication_classes, parser_classes
from rest_framework_csv import parsers as p
@api_view(['POST'])
@authentication_classes((authentication.BasicAuthentication, authentication.TokenAuthentication))
@parser_classes([p.CSVParser])
def CsvConfig(request):
f = request.FILES
return Response({"success": True})
The error I am getting:
{"detail":"CSV parse error - iterator should return strings, not bytes (did you open the file in text mode?)"}
I am using python 3.4.2 django 1.7
This is how my csv looks when I edit it:
First Name|Last Name|Username|Project|SubProject|Role|Phone|Skype
Andreas Kær,Eriksen,s133998,02264F15,1A,Leader,,skype_1
Ernst Magnus,Nylander,s122176,02264F15,1A,Contibutor,,skype_2
Mike Østergaard,Behrens,s133987,02264F15,1B,Leader,,skype_28
Any help would be highly appreciated :)
Metadata
Metadata
Assignees
Labels
No labels