Last active
December 19, 2015 06:59
-
-
Save mbylstra/5915835 to your computer and use it in GitHub Desktop.
If you just want to use Django Rest Framework for authentication and just want to convert a dictionary to json.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rest_framework.renderers import JSONRenderer | |
from rest_framework.response import Response | |
from rest_framework.views import APIView | |
class SimpleView(APIView): | |
renderer_classes = (JSONRenderer,) | |
permission_classes = (IsAuthenticated,) | |
def get(self, request): | |
content = {'testing': 123} | |
return Response(content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment