Django - Delete “Currently” in the image editing form and replace it with the actual image

When editing an object that has an image field, the current image path and the standard field for downloading files are displayed. I want to do this in order to replace the displayed path ("Currently: /pathtoimage.jpg" with the actual image. How to do this?

Thanks in advance!

+6
source share
1 answer

If you are talking about a form in a Django admin, you can override AdminImageWidget.

There are several snippets and posts that explain the details:

For regular forms, you should take a look at django-form-utils :

This application provides utilities to improve Django form processing:

ImageWidget, which displays a thumbnail of an image, not just a file name.

+6
source

Source: https://habr.com/ru/post/886271/


All Articles