A
A
Andrey2016-05-19 13:39:22
Django
Andrey, 2016-05-19 13:39:22

Django Admin not saving images?

There is a Photo model:

class Photo(Model):
    class Meta:
        db_table = 'Photo'
    bar = ForeignKey(Bar)
    image = ImageField((u'Изображение'), upload_to="photos/", help_text=(u'фото'))
    is_active = BooleanField(default=True, blank=False, null=False)

Media settings:
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR,'media/')

I save the object in the admin panel
fef4e489c56f4e4ea083e50e23388ae9.jpg
The object has been saved.
9f7844a5db484dad90d5dc4dd8342d15.jpg
But the folder '/media/photos/' is empty.
Tell me how to find the reason why it does not save? Saved locally approx.

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