title: Django urls with empty values
body: <p>I have a django app where i am making calls to the api as follows: <code>(api.py)</code></p>
  
  <pre><code>class studentList(APIView):
      def get(self, request, pk, pk2, format=None):
          student_detail = Student.objects.filter(last_name = pk, campus_id__name = pk2)
          serialized_student_detail = studentSerializer(student_detail, many=True)
          return Response(serialized_student_detail.data)
  </code></pre>
  
  <p>and in the urls i am doing something like follows:</p>
  
  <pre><code>url(r'^api/student/(?P&lt;pk&gt;.+)/(?P&lt;pk2&gt;.+)/$', api.studentList.as_view()),
  </code></pre>
  
  <p>Now the problem is that my app has a <strong>search</strong> function where it sends the parameters <code>pk</code> and <code>pk2</code> to the api. Sometimes, the user may select only 1 of these parameters to perform <strong>search</strong> operation . So when only one parameter is selected, the url would look something like this:</p>
  
  <pre><code>http://localhost:8000/api/student/##value of pk//
  </code></pre>
  
  <p>or</p>
  
  <pre><code>http://localhost:8000/api/student//##value of pk2/
  </code></pre>
  
  <p>So how will i make the query still work and how do i make a url such that it accepts even these as parameters?</p>