python - Is it possible to apply slicing to django function on template? -


i´m trying make whatsapp button i´m having problems trailing slash @ end on href. whatsapp renders wrongly trailing slash.

i´m using wagtail , puput. i´d on template only because wagtail , puput addons on divio. if install them separatedly, have remake website, can´t change models.py.

i´m using {% canonical_url entry %} href. i´d have {% canonical_url|slice:":-1" entry %}

they provide full_url placeholder, doesn´t add date link. gives foo.com/slug instead of foo.com/2017/09/01/slug gets rendered wrong too.

any suggestions?

thanks!

it should possible use {% canonical_url entry url %} desired url variable url, rather outputting directly tag. after that, can perform slicing on variable using {{ url|slice:":-1" }}.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -