  
  from djangorestframework.compat import View
  from djangorestframework.response import Response, ErrorResponse
  from djangorestframework.mixins import RequestMixin, ResponseMixin, AuthMixin
  from djangorestframework import emitters, parsers, authenticators, validators, status
  
  
  # TODO: Figure how out references and named urls need to work nicely
  # TODO: POST on existing 404 URL, PUT on existing 404 URL
  #
 
</s> remove             # Either generate the response data, deserializing and validating any request data
            # TODO: This is going to change to: func(request, *args, **kwargs)
            # That'll work out now that we have the lazily evaluated self.CONTENT property.
            response_obj = func(request, *args, **kwargs)

            # Allow return value to be either Response, or an object, or None
            if isinstance(response_obj, Response):
                response = response_obj
            elif response_obj is not None:
                response = Response(status.HTTP_200_OK, response_obj)
            else:
                response = Response(status.HTTP_204_NO_CONTENT)

            # Pre-serialize filtering (eg filter complex objects into natively serializable types)
            response.cleaned_content = self.cleanup_response(response.raw_content)

        except ErrorResponse, exc:
            response = exc.response

        # Always add these headers.
        #
        # TODO - this isn't actually the correct way to set the vary header,
        # also it's currently sub-obtimal for HTTP caching - need to sort that out. 
        response.headers['Allow'] = ', '.join(self.allowed_methods)
        response.headers['Vary'] = 'Authenticate, Accept'

        return self.emit(response)
 </s> add             return self.emit(response)
        except:
            import traceback
            traceback.print_exc() </s> remove         response = self.client.get('/')
 </s> add         try:
            response = self.client.get('/')
        except:
            import traceback
            traceback.print_exc() </s> remove             # Typically the context will be a user, or None if this is an anonymous request,
            # but it could potentially be more complex (eg the context of a request key which
            # has been signed against a particular set of permissions)
            auth_context = self.auth

            # If using a form POST with '_method'/'_content'/'_content_type' overrides, then alter
            # self.method, self.content_type, self.CONTENT appropriately.
            self.perform_form_overloading()

            # Ensure the requested operation is permitted on this resource
            self.check_method_allowed(self.method, auth_context)

            # Get the appropriate create/read/update/delete function
            func = getattr(self, self.callmap.get(self.method, None))
 </s> add             # TODO - this isn't actually the correct way to set the vary header,
            # also it's currently sub-obtimal for HTTP caching - need to sort that out. 
            response.headers['Allow'] = ', '.join(self.allowed_methods)
            response.headers['Vary'] = 'Authenticate, Accept' </s> remove     allowed_methods = ('POST',)

 </s> add  </s> remove     # List of RESTful operations which may be performed on this resource.
    # These are going to get dropped at some point, the allowable methods will be defined simply by
    # which methods are present on the request (in the same way as Django's generic View)
    allowed_methods = ('GET',)
    anon_allowed_methods = ()
 </s> add     http_method_names = ['get', 'post', 'put', 'delete', 'head', 'options', 'trace', 'patch']
from djangorestframework import emitters, parsers, authenticators, permissions, validators, status
  
  from djangorestframework.compat import View
  from djangorestframework.response import Response, ErrorResponse
  from djangorestframework.mixins import RequestMixin, ResponseMixin, AuthMixin
from djangorestframework import emitters, parsers, authenticators, permissions, validators, status
  
  
  # TODO: Figure how out references and named urls need to work nicely
  # TODO: POST on existing 404 URL, PUT on existing 404 URL
  #
keep keep keep keep replace keep keep keep keep keep
 Generic permissions added, allowed_methods and anon_allowed_methods now defunct, dispatch now mirrors View.dispatch more nicely 
djangorestframework/resource.py