      def get(self, request, *args, **kwargs):
          return Response({'url': reverse('another', request=request)})
  
  
  class RequestInvalidVersionView(APIView):
      def determine_version(self, request, *args, **kwargs):
          scheme = self.versioning_class()
          scheme.allowed_versions = ('v1', 'v2')
          return (scheme.determine_version(request, *args, **kwargs), scheme)
  
 
</s> remove     def get(self, request, *args, **kwargs):
        return Response({'version': request.version})
 </s> add class AllowedAndDefaultVersionsView(RequestVersionView):
    def determine_version(self, request, *args, **kwargs):
        scheme = self.versioning_class()
        scheme.allowed_versions = ('v1', 'v2')
        scheme.default_version = 'v2'
        return (scheme.determine_version(request, *args, **kwargs), scheme)


class AllowedWithNoneVersionsView(RequestVersionView):
    def determine_version(self, request, *args, **kwargs):
        scheme = self.versioning_class()
        scheme.allowed_versions = ('v1', 'v2', None)
        return (scheme.determine_version(request, *args, **kwargs), scheme)


class AllowedWithNoneAndDefaultVersionsView(RequestVersionView):
    def determine_version(self, request, *args, **kwargs):
        scheme = self.versioning_class()
        scheme.allowed_versions = ('v1', 'v2', None)
        scheme.default_version = 'v2'
        return (scheme.determine_version(request, *args, **kwargs), scheme) </s> remove         view = RequestInvalidVersionView.as_view(versioning_class=scheme)
 </s> add         view = AllowedVersionsView.as_view(versioning_class=scheme) </s> remove         return (version == self.default_version) or (version in self.allowed_versions)
 </s> add         return ((version is not None and version == self.default_version) or
                (version in self.allowed_versions)) </s> remove         view = RequestInvalidVersionView.as_view(versioning_class=scheme)
 </s> add         view = AllowedVersionsView.as_view(versioning_class=scheme) </s> remove         view = RequestInvalidVersionView.as_view(versioning_class=scheme)
 </s> add         view = AllowedVersionsView.as_view(versioning_class=scheme)
class AllowedVersionsView(RequestVersionView):
      def get(self, request, *args, **kwargs):
          return Response({'url': reverse('another', request=request)})
  
  
class AllowedVersionsView(RequestVersionView):
      def determine_version(self, request, *args, **kwargs):
          scheme = self.versioning_class()
          scheme.allowed_versions = ('v1', 'v2')
          return (scheme.determine_version(request, *args, **kwargs), scheme)
  
keep keep keep keep replace keep keep keep keep keep
 Fix handling of ALLOWED_VERSIONS and no DEFAULT_VERSION (#4370)

When only `ALLOWED_VERSIONS` but no `DEFAULT_VERSION` is specified, a
version should be enforced. 
tests/test_versioning.py