[Solved]-Upload an image from Django shell



I’d been bit by this before, so I feel you β€” but as per my comment: replace the 'r' with 'rb' in the File() call, and it should work fine.

I should also add, for those who come upon this answer later, that this is an issue specific to Python3. Take a look at the SO link in Steve’s comment for a fuller explanation of the difference in File() between p2 and p3.


Leave a comment