Search code examples
pythondjangodjango-modelsdjango-uploads

Images are not being stored?? - Django


These are my following settings:

MEDIA_ROOT = '/home/webapps/test_project/media/'
MEDIA_URL = 'http://192.168.0.2:8090/site_media/'
ADMIN_MEDIA_PREFIX = '/media/'

These are my model fields:

large = models.ImageField(blank=True, null=True, upload_to="images")
thumb = models.ImageField(blank=True, null=True, upload_to="images")

What happens is... when I save a model with the images, the paths to the images are stored but not the actual images.

http://192.168.0.2:8090/site_media/images/BluUnicorn.png http://192.168.0.2:8090/site_media/images/DarkNinja.png ...

Django behaves as if the images have been saved succesfully under the images folder, but the images are not actually there!!


Anyone have a clue of what I did wrong?

PS: I'm using Django 2.1+ SVN


Solution

  • Mistyped

    MEDIA_ROOT = '/home/webapps/test_project/media/'
    

    wrote home instead of root