Hello,
I am new to Django and have implemented two views and their corresponding template pages and they are working well in Django 1.6. However, when migrating to Django 1.7, I got an error "I/O operation on closed file" when getting to the second view function. I found out the root cause for this error is that on Django 1.7, InMemoryUploadedFile object retrieved from request.FILES got automatically closed at the end of the request by Django. I am trying to find a solution to work around this migration issue. Specifically, the first view and its template page ask users to browse files, and the files can be retrieved from request.FILES and saved to a global variable for use by the second view/request. Since the file got closed automatically at the end of the first request, when the second view tries to operate on this file, that "I/O operation on closed file" error results.
This is my first post, and I am trying to get some recommendations/suggestions on how to handle this use case to work around this new security feature implemented in Django 1.7 (i.e., automatically close file at the end of each request). Any help and suggestions are greatly appreciated.
Thanks,
Hong