added custom user endpoints

This commit is contained in:
Sam
2021-01-25 12:15:11 +00:00
parent b2c857878b
commit f94d822d5e
6 changed files with 259 additions and 1 deletions

View File

@@ -1,3 +1,19 @@
from django.shortcuts import render
from django.http import HttpResponse
from rest_framework import status
from rest_framework import viewsets
from rest_framework.response import Response
from rest_framework.permissions import IsAdminUser
from . import models
from . import serializers
# Create your views here.
class CustomUserViewSet(viewsets.ModelViewSet):
model = models.CustomUser
serializer_class = serializers.CustomUserSerializer
model_name = 'custom_user'
queryset = models.CustomUser.objects.all()
permission_classes = [IsAdminUser,]