1👍
✅
You can’t just give paths to files on the disk of your server, you need to actually serve the files through your webserver and use django’s django.contrib.staticfiles
to reference those files from within your application:
def boton(self,obj):
return mark_safe('<img src="{{ STATIC_URL }}admin/img/pdf.png" alt="PDF">')
0👍
Try this will work as expected.
def image_data(self, obj):
return mark_safe('<img src="{{ STATIC_URL }}%s"alt="PDF" width=50 height=50>' %( str(obj.image_file) ))
- [Answer]-Password reset not working in Django 1.6.1
- [Answer]-How to upload a file using Django and Google App Engine Blobstore API
- [Answer]-Django JSON response does not attached to jQuery post sucess
Source:stackexchange.com