在我看来,我有以下表单逻辑:
if request.method == 'POST':
form = MyForm(request.POST, request.FILES)
if form.is_valid():
my_form = form.save() )
print 'before redirect'
redirect('customer:department-edit')
print 'after redirect'
我的网址条目如下所示:
url(r'^departments/$', views.departments_view, name='department-edit'),
我得到以下输出:
before redirect
after redirect
为什么提交表单后不会发生重定向?