code: def get_maintenance_response(request):
      
      if settings.MAINTENANCE_MODE_REDIRECT_URL:
          return redirect(settings.MAINTENANCE_MODE_REDIRECT_URL)
  
      context = {}
  
      if settings.MAINTENANCE_MODE_GET_TEMPLATE_CONTEXT:
          try:
              get_request_context_func = import_string(
                  settings.MAINTENANCE_MODE_GET_TEMPLATE_CONTEXT)
          except ImportError:
              raise ImproperlyConfigured(
                  'settings.MAINTENANCE_MODE_GET_TEMPLATE_CONTEXT '
                  'is not a valid function path.'
              )
  
          context = get_request_context_func(request=request)
  
      if django.VERSION < (1, 8):
          kwargs = {'context_instance': RequestContext(request, context)}
      else:
          kwargs = {'context': context}
  
      response = render(request, settings.MAINTENANCE_MODE_TEMPLATE,
                        status=settings.MAINTENANCE_MODE_STATUS_CODE,
                        **kwargs)
      response['Retry-After'] = settings.MAINTENANCE_MODE_RETRY_AFTER
      add_never_cache_headers(response)
      return response
docs: Return a '503 Service Unavailable' maintenance response.