[Answered ]-Uploded image not saved in media folder

1👍

Change MEDIA_URL and MEDIA_ROOT to:

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, "media")

Once you define above you don’t need to explicitly put media folder inside ImageField:

profile_image = models.ImageField(upload_to="images")

See the official docs about managing files

0👍

firstly change to this

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, "media")

and in you model

profile_image = models.ImageField(upload_to="images")

and i guess you are using form to upload the image so in that

<form method="POST" enctype="multipart/form-data">
       

use enctype and if still doesn’t work for you try to update it from admin panel than tell me it update or not

Leave a comment