      def http_method_not_allowed(self, request, *args, **kwargs):
          """
          Return an HTTP 405 error if an operation is called which does not have a handler method.
          """
          raise ErrorResponse(status.HTTP_405_METHOD_NOT_ALLOWED,
                              {'detail': 'Method \'%s\' not allowed on this resource.' % request.method})
  
      def initial(self, request, *args, **kargs):
          """
          Hook for any code that needs to run prior to anything else.
          Required if you want to do things like set `request.upload_handlers` before
 
</s> remove         Hook for any code that needs to run prior to anything else.
 </s> add         Returns an `HttpRequest`. This method is a hook for any code that needs to run
        prior to anything else. </s> remove         Hook for any code that needs to run after everything else in the view.
 </s> add         Returns an `HttpResponse`. This method is a hook for any code that needs to run
        after everything else in the view. </s> remove 
        # Always add these headers.
        response.headers['Allow'] = ', '.join(self.allowed_methods)
        # sample to allow caching using Vary http header
        response.headers['Vary'] = 'Authenticate, Accept'

        # merge with headers possibly set at some point in the view
        response.headers.update(self.headers)
        return self.render(response)

    def add_header(self, field, value):
        """
        Add *field* and *value* to the :attr:`headers` attribute of the :class:`View` class.
        """
        self.headers[field] = value
 </s> add         return response </s> remove     status.HTTP_403_FORBIDDEN,
    {'detail': 'You do not have permission to access this resource. ' +
               'You may need to login or otherwise authenticate the request.'})
 </s> add     content={'detail': 'You do not have permission to access this resource. ' +
               'You may need to login or otherwise authenticate the request.'},
    status=status.HTTP_403_FORBIDDEN)
        raise ErrorResponse(content=
                {'detail': 'Method \'%s\' not allowed on this resource.' % request.method},
            status=status.HTTP_405_METHOD_NOT_ALLOWED)
      def http_method_not_allowed(self, request, *args, **kwargs):
          """
          Return an HTTP 405 error if an operation is called which does not have a handler method.
          """
        raise ErrorResponse(content=
                {'detail': 'Method \'%s\' not allowed on this resource.' % request.method},
            status=status.HTTP_405_METHOD_NOT_ALLOWED)
        raise ErrorResponse(content=
                {'detail': 'Method \'%s\' not allowed on this resource.' % request.method},
            status=status.HTTP_405_METHOD_NOT_ALLOWED)
  
      def initial(self, request, *args, **kargs):
          """
          Hook for any code that needs to run prior to anything else.
          Required if you want to do things like set `request.upload_handlers` before
keep keep keep keep replace replace keep keep keep keep keep
 Response as a subclass of HttpResponse - first draft, not quite there yet. 
djangorestframework/views.py