Passing a list through url in django
<p>I want to pass a list through the url. But when i tried, i got some errors. So how can i do that. Somebody please help me..</p>

<p>this is my view</p>

<pre><code>def add_student(request):

    if request.method == 'POST':
        student_list = []
        student_name = request.POST.getlist('student_name')
        student_phone = request.POST.getlist('student_phone')

        zipped = zip(student_name,student_phone)

        for student_name,student_phone in zipped:

            student_object = Student(
                                student_name=student_name,
                                student_phone=student_phone
                            )
            student_object.save()

            student_list.append(student_object.id)

        return HttpResponseRedirect(reverse('students:view_students', args=student_list))
**# in the above code it throwing some errors** 
    else:
        return render(request,'students/add_student.html')


def view_students(request,student_list=None):
    if student_list:
        instances = Student.objects.filter(id__in=student_list)
    else:
        instances = Student.objects.filter()
    context = {}
    context['instances'] = instances

    return render(request,'students/view_all_student.html',context)
</code></pre>

<p>this is my url :</p>

<pre><code>url(r'^view-students/(?P&lt;student_list&gt;\w+)/$',views.view_students, name='view_students'),
</code></pre>

<p>this is the error i got.</p>

<pre><code>NoReverseMatch at /app/product/add-product/

Reverse for 'view_products' with arguments '(14, 15)' and keyword arguments '{}' not found. 1 pattern(s) tried: [u'app/product/view-products/(?P&lt;pd_list&gt;.*)/$']
</code></pre>

<p>here (14,15) are the list items.</p>

<p>If the question is not correct. Somebody please correct the question.</p>