I am uploading and importing a CSV file in Django. Each row has a "description" field which could have line breaks. Currently all the line breaks are lost when saving to Django TextField and this causes all the formatting to be lost. The user then has go to the web portal or admin console and manually format the text for the description field. This is really tedious and time consuming when you hundreds of records.
Is there a way to maintain formatting when importing a CSV file?
Currently I am using:
file = request.FILES['csv_file']
csv_file_data = [row for row in csv.reader(file.read().splitlines())]