Django: Using a variable as the URL namespace?

前端 未结 1 902
鱼传尺愫
鱼传尺愫 2021-01-23 09:46

I\'m trying to create a submenu for a sports site. Each sport would need its own submenu. The problem I\'m having is I need the namespace itself to be dynamic in someway.

相关标签:
1条回答
  • 2021-01-23 10:05

    You can use the add template filter:

    <a href="{% url sport_menu.sport_slug|add:':monthly' %}">Monthly View</a>
    
    0 讨论(0)
提交回复
热议问题