def is_user_exists(request):
"""
Checks if user is exists. If exists return True, else False.
"""
try:
User.objects.get(username=request.data.get('username'))
return Response({'status': 200,
'detail': 'successful',
'data': {'user': True}})
except ObjectDoesNotExist:
return Response({'status': 200,
'detail': 'successful',
'data': {'user': False}})
# ----------------------------------------------------------------------------------------------------------------------
评论列表
文章目录