In this recipe, we will take a look at the easiest way to handle image uploads. We will add a picture field to the Idea model, and we will create image versions of different dimensions for different purposes.
Uploading images
Getting ready
For images with image versions, we will need the Pillow and django-imagekit libraries. Let's install them with pip in your virtual environment (and include them in requirements/_base.txt):
(env)$ pip install Pillow
(env)$ pip install django-imagekit==4.0.2
Then, add "imagekit" to INSTALLED_APPS in the settings.