【发布时间】:2011-09-27 07:47:01
【问题描述】:
我有基于 https://docs.djangoproject.com/en/dev/topics/auth/#django.contrib.auth.views.logout 的 url 配置
这里是:
url(r'^logout(?P<next_page>.*)$', 'logout', name='auth_logout_next'),
在模板中我使用这样的代码:
<a href="{% url auth_logout_next request.path %}">{% trans "Logout" %}</a>
它工作得很好,但我在某些页面中可能有 GET 值 - ?page=2,所以 request.path 删除了这些值。如果可能的话,我应该如何不仅传递现有页面,还要传递 GET 值。
【问题讨论】: