Django wrong imagefield.path

i have a model with an image field like this

app_icon = models.ImageField(upload_to='icons/')

the project has 'uploads' as media folder, which has subfolders, including 'icons'. The image is correctly uploaded to the 'icons' subfolder but when i try to access it using self.app_icon.path it returns .../uploads/imagename.jpg instead of .../uploads/icons/imagename.jpg so i get file not found error. Even the url doesn't include the 'icons' subfolder

my settings:

MEDIA_URL = '/uploads/'
MEDIA_ROOT = BASE_DIR / 'uploads/'

i can't find any answer to this problem, which seems so random to me.

Back to Top