“Upload” a file from django shell
问题 I need to import some data from a excel file and a folder with images, every row in the excel describes every entry and have a list of filenames in the folder (photos related to the entry). I've done a script which creates every entry in the database and saves it trough the django shell, but i have no idea how to instantiate a InMemoryUploadedFile for save it with the model. In django 1.0 I had this small class which allowed me to do what i need, but with changes in django 1.1 it's not