Re: How to resize and store pics with Django

2016-06-03 Thread monoBOT
You should take a look to this plugin ... does exactly what you need. http://djangothumbnails.com/ the user uploads the image and you create as many thumbnails for thoses images as needed 2016-06-03 21:07 GMT+01:00 ivan77 : > Thanks! > > On Friday, June 3, 2016 at 2:08:01 PM UTC-4, Ketan Bhatt

Re: How to resize and store pics with Django

2016-06-03 Thread ivan77
Thanks! On Friday, June 3, 2016 at 2:08:01 PM UTC-4, Ketan Bhatt wrote: > > I am storing links of these images as I need to show them on the frontend, > not connected to any user. > > But I have done what you are talking about too. > So Django gives you a Model File Field. Add that to your Mode

Re: How to resize and store pics with Django

2016-06-03 Thread Ketan Bhatt
I am storing links of these images as I need to show them on the frontend, not connected to any user. But I have done what you are talking about too. So Django gives you a Model File Field. Add that to your Model. That will allow you to save and store files. While saving a model object, just use t

Re: How to resize and store pics with Django

2016-06-03 Thread ivan77
Hi Ketan, Thanks for the information! How is it that you keep the images associated with other tables in the database? What I am specifically thinking about is if you want to associate specific images with specific users who uploaded, for example? Some kind of bridge (many to many table)?

Re: How to resize and store pics with Django

2016-06-03 Thread Ketan Bhatt
This is how you can compress the images while saving: ```python import urllib2 import cStringIO from boto3.session import Session from PIL import Image aws_session = Session( aws_access_key_id=settings.AWS_ACCESS_KEY_ID, aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY, region