Skip to content
Advertisement

Image not showing from Django rest api in Reactjs

data i’ve got from server:

JavaScript

in React:

JavaScript

in Django:

I think there is no problem in django. I made a template and tried to show image, and it worked.

So, how do I show image in React ?

Advertisement

Answer

Api returning only path of image .so append base url before image link like below

JavaScript

or in django you have to send full url in image value like below

JavaScript

so no need to append base url

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement