I
I
idin2018-02-21 16:12:15
Django
idin, 2018-02-21 16:12:15

How In Django, how can I make image field thumbnails?

I am learning Janga and making a simple blog. And I have such a model.

class Article(models.Model):
   article_title = models.CharField('Статья', max_length=100)
    article_date = models.DateTimeField('Дата ')
    article_micro_text = models.TextField('микротекст', blank=True, default='')
    article_text =RichTextUploadingField('Текст',blank=True,default='')
    article_image = models.ImageField('Изображение',blank=True, upload_to='blog')
    # size is "width x height"
    cropping = ImageRatioField('article_image', '750x422')

I am using image_cropping.
And I would like to know how you can make, for example, 2 more miniatures, for example, in sizes 250x400 and 100x100 so that they are made automatically.
And the Miniature 300x500 was like another crop.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Penshin, 2018-02-21
@Izy

https://github.com/matthewwithanm/django-imagekit
https://github.com/jazzband/sorl-thumbnail

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question