In my django app, I have a view which accomplishes file upload.The core snippet is like this
...
if (request.method == \'POST\'):
if request.FILES.has_
From Django docs on Client.post:
Submitting files is a special case. To POST a file, you need only provide the file field name as a key, and a file handle to the file you wish to upload as a value. For example:
c = Client()
with open('wishlist.doc') as fp:
c.post('/customers/wishes/', {'name': 'fred', 'attachment': fp})