title: Django Rest Framework view set url filter errors
body: <p>I am building a backend using the django rest framework. I am building the defauly django user viewsets and urlpattern routers. I want to add a filter for the username in the url if there is a username passed in and if not, then show all the users. I will have my code below. </p>
  
  <p>This is the views:</p>
  
  <pre><code>from django.contrib.auth.models import User
  from ..serializers import UserSerializer
  from rest_framework import viewsets
  
  class UserViewSet(viewsets.ModelViewSet):
      serializer_class = UserSerializer
  
      def get_queryset(self):
          queryset = User.objects.all()
          username = self.request.query_params.get('username', None)
          if username is not None:
              queryset = queryset.filter(username = username)
          return queryset
  </code></pre>
  
  <p>Here is the urls file:</p>
  
  <pre><code>from users.api.views.userViews import UserViewSet
  from rest_framework.routers import DefaultRouter
  
  router = DefaultRouter()
  router.register(r'(?P&lt;username&gt;.+)/$', UserViewSet, base_name='user')
  urlpatterns = router.urls
  </code></pre>
  
  <p>here is the urls in the settings:</p>
  
  <pre><code>path('api/users/', include('users.api.urls.userUrls')),
  </code></pre>
  
  <p>I want the following:</p>
  
  <p><code>api/users/</code> to return all users 
  &amp;
  <code>api/users/testAdmin</code> to return the admin user object</p>