A
A
AlexandrBirukov2017-08-21 15:19:49
Django
AlexandrBirukov, 2017-08-21 15:19:49

Default image for ImageField?

img = models.ImageField('Изображение', upload_to='images', default='default.png')

The model is created automatically, you need to set the default image, the question is how to take it from static? If you set the path to the image, then an error occurs:
The joined path (/static/main/img/default.png) is located outside of the base path component
Thank you in advance.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question