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

14 lines
435 B
Python
Raw Normal View History

from __future__ import unicode_literals
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})