html - 我可以在 Django 中再次使用 urls 参数吗?
问题描述
path('list/<location_id>/', views.MyView.as_view(), name='myview'),
path('list/<location_id>/<category_id>/', views.MyView.as_view(), name='myview_category')
我使用主页'myapp/list/2/','myapp/list/4/',......
我想在myview中使用类别功能。
但是我无法在 HTML 中再次编写使用 location_id 的 url 链接。
<li><a href="{% url 'cafeyo:myview_category' location_id=# category_id=1 %}">category 1</a></li>
如何使用 location_id ???
请帮我...
解决方案
推荐阅读
- php - DateTime diff 与不同时区的不一致
- flutter - Flutter 说 fontFamily 在 IS 时没有定义?
- android - Android 应用内订阅实现
- c# - Newtonsoft.Json:使用字典
> 作为 JProperty 的内容值 - java - 如何根据java中的十进制值将十进制/浮点值增加0.1或0.001
- r - 在参数中连接字符串
- nestjs - 使用 TypeORM 选择有限数量的关系 (OneToMany)
- javascript - 使用 Javascript 更新 Google Earth Engine API 中资产的元数据
- java - 获取输入并替换现有文件中的这些数据
- c# - AutoSized 文本框中的屏幕闪烁