1
You haven’t shown any code that calls the image
method, so I don’t see how it can ‘send’ the display_image
variable to the page.
If you want to add a variable to the template context, I suggest you try overriding the get_context_data
method.
Source:stackexchange.com