In Django whenever we change the value for Image Field, a path is created for that image. Here I will be using Django form to edit/change the image. The reason for using the Django forms is that it will automatically set the path for image which really reduce the extra work for setting the path manually for image.

let’s take an example of having image field in class product and stored in static folder, it can be any folder, it’s up to you where you want to store it.

Now for the Image field in class Product i will…

Shantanu Awasthi

Python Programmer, Django Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store