You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
512 B

from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from game.models.player.player import Player
class InfoView(APIView):
permission_classes = ([IsAuthenticated])
def get(self,request):
user = request.user
player = Player.objects.get(user=user)
return Response({
'result':"success",
'username':user.username,
'photo':player.photo,
})