After uploading image is not displaying in production server.

17 views
Skip to first unread message

Salima Begum

unread,
May 31, 2021, 5:52:48 AM5/31/21
to django...@googlegroups.com
Hi all,
In my project after depl;oying into production server When i have uploaded images it saves into media folder but not displaying image in template. As well as when we go to the admin site and to display an image when I click on the url of the image it is throwing an error like. url not found.

But in the media folder the image is saved and when I double click on that image is opened. and when i upload an image from the admin site, the image is displayed in a template.

Actually in development server uploading displaying images is working good. After deploying into the production server I have this issue. Please help me to solve this issue.
 
**settings.py**
```
# managing media
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'
```

Project urls.py

```
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
```

Thanks
~Salima

Reply all
Reply to author
Forward
0 new messages