Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
<a href={% url home %}></a>
我在 Django API 中找不到 {% url %}。
网址
返回与给定视图函数和可选参数匹配的绝对 URL(即,没有域名的 URL)。这是一种在不违反 DRY 原则的情况下输出链接的方法,因为它必须在模板中对 URL 进行硬编码:
{% url path.to.some_view arg1,arg2,name1=value1 %}