Я пытаюсь сделать функцию загрузки в форме, но когда я нажимаю кнопку загрузки, она выдает ошибку: NoReverseMatch в / customer / 1 / list /
Вот код в представлении
def list(request,pk):
# Handle file upload
if request.method == 'POST':
form = DocumentForm(request.POST, request.FILES)
if form.is_valid():
newdoc = Document(docfile = request.FILES['docfile'])
form.cId = pk;
newdoc.save()
# Redirect to the document list after POST
return HttpResponseRedirect(reverse('list'))
# render(request, 'list.html', {'documents': documents, 'form': form})
else:
form = DocumentForm() # A empty, unbound form
# Load documents for the list page
documents = Document.objects.all()
# Render list page with the documents and the form
return
Вот код в URL
url(r'^customer/(?P<pk>\d+)/list/$', Views.list, name='list'),
, пожалуйста, помогите