嗨,我试图从一个视图函数重定向到另一个视图函数并将列表列表作为参数传递。
网址.py
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^checkFiles/', views.checkFiles, name='checkoutFiles'),
url(r'^$', views.home, name='home'),
url(r'^upload/', views.upload, name='upload'),
url(r'^login', views.loginview, name='loginview'),
url(r'^logout/', views.logoutview, name='logoutview'),
url(r'^confirm_files/', views.upload, name='confirm_file'),
url(r'^upload/', views.del_files, name='del_files'),
]
视图.py
从views.upload重定向到views.checkoutFiles我使用这个命令
return redirect(reverse('checkoutFiles', kwargs={'ACCEPTED_FILES':ACCEPTED_FILES}))
...
def checkFiles(request, ACCEPTED_FILES):
print ACCEPTED_FILES
return render(request, 'confirm_files.html', {
'ACCEPTED_FILES': ACCEPTED_FILES
})
我收到此错误消息
NoReverseMatch: Reverse for 'checkoutFiles' with keyword arguments '{'ACCEPTED_FILES': [[u't2_r0Oqwl7.txt', '0.98 KB', u'text/plain']]}' not found. 1 pattern(s) tried: ['checkFiles/']
django 版本:1.11.2