Join GitHub today
add template tag for dynamic image url #2461
Dynamic image view allow us to serve image rendition outside the main request (which is a real performance boost in some cases!! In my use case, it goes from ~400 to ~15 SQL queries!! ).
However, building rendition image url on Python side could be not enough. A common use-case could be do generate url in templates. I'm pretty sure I'm not the only one?
This PR basically copy/paste the example given in the docs : http://docs.wagtail.io/en/latest/advanced_topics/images/image_serve_view.html#generating-dynamic-image-urls-in-python
The util function is just wrapped into a simple template tag so it can still be used directly in Python code.
Hope it could be merge and thanks for review!
@kaedroho , I have rebase the master branch to be more up-to-date. It could be practical to also have this PR merged for the 1.5 release since the PR #2459 was merged. Is that should be possible ? At least it needs doc. I was thinking about adding some notes
EDIT: just after, of course