<p>请考虑以下几点:</p>
<p>网址.py:</p>
<pre><code>urlpatterns = patterns('',
('^test/$', ClassView.as_view()),
)
</code></pre>
<p>视图.py:</p>
<pre><code>class ClassView(View):
def get(self, request):
return HttpResponse("test")
def post(self, request):
# do something
return redirect(ClassView.get(request)) # What should I do to redirect to a class here without specifying the path?
</code></pre>
<p>我想重定向到ClassView的get函数(/test/),但是当我尝试上述操作时,我得到:</p>
<pre><code>NoReverseMatch at /test/
</code></pre>
<p>所以很明显它找到了网址,但是说没有匹配的?</p>