[Fixed]-Showing a Picture in Django Action Stream

1👍

For anyone searching, I solved this with a template filter:

myapp/templatetags/myapp_tags

@register.filter
def get_pic(value):
    value = Photo.objects.get(pk=value).photo.url
    return value

template.html

{% for event in stream %}
    <div class="front w3-image">
     <img src="{{ event.target_object_id|get_pic }}" class="w3-image" style="height:inherit" >
            </div>
    {% endfor %}

Hope it helps someone

Leave a comment