我不得不稍微改变我的模板来做一些 URL 重定向,所以我使用:
<script>
if window.location="www.somesite.com"{
window.location="www.someothersite.com{% url app.views.some_view argument %}"
}
</script>
但我不断收到错误NoReverseMatch: Reverse for 'app.views.some_view' with arguments 'xxx' and keyword arguments '{}' not found.
我正在使用{% load url from future%}
,并且我确信该特定链接在没有 Javascript 的情况下可以正常工作。