class TestView(views.APIView):
def get(self, request, format=None):
return response.Response({'test': 'test'})
from rest_framework import routers
import views
api_router = routers.DefaultRouter(trailing_slash=False)
api_router.register('test', views.TestView, base_name='test')
urlpatterns = api_router.urls
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-fram...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+unsub...@googlegroups.com.