我有if
的静态页面:
{% if request.get_full_path == "billing/address/" %}
test
{% endif %}
如何用从此处获得的路径替换billing/address/
:
path('billing/address/<slug:address_slug>/', views.addressChange, name='edit-address')
谢谢大家
答案 0 :(得分:1)
如果我正确理解了您的问题,则Python的 in
操作人员将发挥作用:)
{% if "billing/address/" in request.get_full_path %}
test
{% endif %}