repo_description: A community-supported supercharged document management system: scan, index and archive all your documents
repo_topics: angular archiving django dms document-management document-management-system hacktoberfest machine-learning ocr optical-character-recognition pdf
code: from django.conf import settings
  
  from paperless import version
  
  
  class ApiVersionMiddleware:
      def __init__(self, get_response):
          self.get_response = get_response
  
      def __call__(self, request):
          response = self.get_response(request)
          if request.user.is_authenticated:
              versions = settings.REST_FRAMEWORK["ALLOWED_VERSIONS"]
              response["X-Api-Version"] = versions[len(versions) - 1]
              response["X-Version"] = version.__full_version_str__
  
          return response
  