Skip to content

Instantly share code, notes, and snippets.

@mjpieters
Created April 10, 2018 07:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjpieters/d92ad837a6262cc2699b20d44d295c62 to your computer and use it in GitHub Desktop.
Save mjpieters/d92ad837a6262cc2699b20d44d295c62 to your computer and use it in GitHub Desktop.
import csv, io
# ....
with io.TextIOWrapper(request.FILES["csv_file"].file, encoding='utf8', newline='') as csvfile:
reader = csv.DictReader(csvfile, fields=('name', 'start_date_time', 'end_date_time', 'notes'))
for data_dict in reader:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment