django-rest-framework/tests/browsable_api/views.py

12 lines
394 B
Python
Raw Normal View History

2015-06-25 23:55:51 +03:00
from rest_framework import authentication, renderers
from rest_framework.response import Response
2015-06-25 23:55:51 +03:00
from rest_framework.views import APIView
class MockView(APIView):
authentication_classes = (authentication.SessionAuthentication,)
renderer_classes = (renderers.BrowsableAPIRenderer, renderers.JSONRenderer)
def get(self, request):
return Response({'a': 1, 'b': 2, 'c': 3})