how to access uploaded file list in django forms.py

2016-08-24 Thread ali Eblice
Hello friends how can i access uploaded file list (multi file upload) in forms.py ? In a view i access file list like this : *request.FILES.getlist('files')* but in forms.py i get this error: *Exception Value:'UploadForm' object has no attribute 'request'* i tried to add request object to

is it possible to manipulate image in PIL after uploading directly by its "request.FILES.GETLIST(FORMFIELD)" address not the saved picture on hard disk

2016-08-26 Thread ali Eblice
Hello Friends is it possible to manipulate image in PIL after uploading directly by its " *request.FILES.GETLIST(FORMFIELD)*" address not the saved picture on hard disk? I wrote a function for manipulating but its only working with " *Image.open('a.jpg')* " but i don't want to save image afte

problem in converting PIL image object to django file object for saving in imagefield model type

2016-09-10 Thread ali Eblice
Hi everybody I wanted to save PIL image object in model ImageField , but before doing that i have to convert PIL image object to django file-like object I found a solution with stringIO but the problem is that in this solution " io_object.len" is used and "len" is not available in pythin3 here is

Re: is it possible to manipulate image in PIL after uploading directly by its "request.FILES.GETLIST(FORMFIELD)" address not the saved picture on hard disk

2016-09-10 Thread ali Eblice
umentation for the `frombytes` method: > https://pillow.readthedocs.io/en/3.3.x/reference/Image.html#PIL.Image.frombytes > > Hope that helps. > Regards, > > Asad Jibran Ahmed > > http://blog.asadjb.com > > On Fri, Aug 26, 2016 at 7:46 PM, ali Eblice > wrote: > >> H

Re: problem in converting PIL image object to django file object for saving in imagefield model type

2016-09-10 Thread ali Eblice
n after the seek operation. So io_object.seek(0, os.SEEK_END) > will tell you the number of characters in io_object. That should be > equal to the size. > > 2016-09-10 9:49 GMT+02:00 ali Eblice >: > > Hi everybody > > I wanted to save PIL image object in model ImageFi

Re: Import css in Django

2016-09-11 Thread ali Eblice
your "mysite" folder and "static" folder are in a same directory but in your settings.py you wrote "STATIC_ROOT='/mysite/static/'" which says that static should be subdirectory of mysite which its not a subdirectory its in a same directory of mysite On Sunday, September 11, 2016 at 8:48:57 PM U

question about returning file (pdf,image,zip...) in a request that made from temporary URL

2016-10-28 Thread ali Eblice
hello think of a downloading website: when we create a temporary link in django and map it to actual URL or file path in database like this: id -- temporary_URL -- origin_URL -- file_path so when a user used a temporary URL and directed to some view , how should i return that file from that v

Re: question about returning file (pdf,image,zip...) in a request that made from temporary URL

2016-10-30 Thread ali Eblice
80 so the response wont go to apache so it cause me to download the file with 0 byte size how can i solve this problem ? On Friday, October 28, 2016 at 6:29:53 PM UTC+3:30, ali Eblice wrote: > > hello > think of a downloading website: > when we create a temporary link in django and m