Passing variable urlname to url tag in django template

后端 未结 4 889
孤街浪徒
孤街浪徒 2020-12-14 18:41

What I\'d like to do (for a recent changes \'widget\' - not a django widget in this case) is pass a urlname into my template as a variable, then use it like so: {% url

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-14 19:23

    if you are using Django 1.5 and up, django-reversetags is not required anymore for just passing view names as variables into templates, to be used within the url tag.

    I was confused with the availability of django-reversetags, just thought of updating the matter correctly here.

提交回复
热议问题