title: Django Rest Framework: 'function' object has no attribute 'as_view'
body: <p>I've been trying for a while to get a ModelResource or a View working using the Django Rest Framework. I'm following the examples but the code in the examples is not working for me. Can anyone tell me why I might be getting this error.</p>
  
  <p>views.py</p>
  
  <pre><code># Create your views here.
  from django.http import HttpResponse
  from django.utils import simplejson
  from django.core import serializers
  
  from djangorestframework.views import View
  from djangorestframework.response import Response
  from djangorestframework import status
  
  from interface.models import *
  
  def TestView(View):
      def get(self, request):
          return Person.objects.all()
  </code></pre>
  
  <p>urls.py</p>
  
  <pre><code>from django.conf.urls.defaults import *
  from djangorestframework.resources import ModelResource
  from djangorestframework.views import ListOrCreateModelView, InstanceModelView, View
  from interface.models import *
  from interface.views import *
  
  class PersonResource(ModelResource):
      model = Person
      ordering = ('LastName')
  
      urlpatterns = patterns('',    
      url(r'^$', 'interface.views.index'),
      url(r'^testview/$', TestView.as_view()),
      url(r'^people/$', ListOrCreateModelView.as_view(resource=PersonResource)),
  )
  </code></pre>
  
  <p>I'm now getting the error 'function' object has no attribute 'as_view'.</p>