这是我的 urls.py:
urlpatterns = patterns('horizon.views',
url(r'home/$', 'user_home', name='user_home'),
url(r'register/$', Register.as_view(), name='register'),
url(r'success/$', Success.as_view(), name='success')
)
这是我的views.py:
class Register(forms.ModalFormView):
template_name = 'auth/test.html'
form_class = CreateUser
success_url = reverse_lazy('login')
class Success(generic.TemplateView):
template_name = 'auth/success.html'
我尝试使用:
return HttpResponseRedirect('success')
或者
return HttpResponseRedirect(reverse('success'))
但它无法呈现success.html。谁能告诉我为什么?非常感谢 !