1
url(r'^currentuser$', views.CurrentUser.as_view(), name='current-user'
但它如下返回錯誤..
NameError調用基於類視圖
class CurrentUser(APIView):
authentication_classes = (authentication.TokenAuthentication,)
def get(self, request, format=None):
for user in User.objects.all()
if request.user.is_authenticated():
fullname = get_full_name(user)
return Response(fullname)
at/currentuser 全局名稱'get_full_name'未定義