I am trying to build my blog site with Django as the backend and React as the frontend. For the REST API, I am using the Django Rest Framework library.
I created a Blog
model with an image field and set the media and static URLs in the settings.py
file.
Now, when I fetch the blogs in React with Axios, it doesn’t show the images, but I can see the blog titles and other fields.
I ensured that the Django settings for media files are correctly configured. The image URLs are present in the API response when I inspect the network requests.enter image description here
enter image description here
enter image description here
ABDUR RAHMAN is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.