fix prev commit

parent af89ec24
Pipeline #49 failed with stages
in 0 seconds
Showing with 37 additions and 6 deletions
+37 -6
......@@ -21,13 +21,15 @@ django-admin startproject backend
python backend\manage.py startapp api
```
#### Create react project
#### Create vue project
```bash
npm create-react-app fronted
npm i bootstrap
su
npm install -g @vue/cli
vue create frontend
cd frontend
npm i axios
npm react-router-dom
npm react-bootstrap
vue add vuetify
vue add router
```
#### Create migration
......
No preview for this file type
......@@ -2,8 +2,13 @@ from django.shortcuts import render
from rest_framework import generics
from .models import user
from .serializers import *
from rest_framework.permissions import IsAuthenticated
from rest_framework.views import APIView
from rest_framework.response import Response
# Create your views here.
class UserApiView(generics.ListAPIView):
queryset = user.objects.all()
serializer_class = UserSerializer
......@@ -13,14 +18,38 @@ class LessonApiView(generics.ListAPIView):
queryset = lesson.objects.all()
serializer_class = LessonSerializer
class UserGroupApiView(generics.ListAPIView):
queryset = user_group.objects.all()
serializer_class = UserGroupSerializer
class CabinetApiView(generics.ListAPIView):
queryset = cabinet.objects.all()
serializer_class = CabinitSerializer
class SheduleApiView(generics.ListAPIView):
queryset = shedule.objects.all()
serializer_class = SheduleSerializer
\ No newline at end of file
serializer_class = SheduleSerializer
class LogoutView(APIView):
permission_classes = (IsAuthenticated)
def post(self, request):
try:
refresh_token = request.date['refresh_token']
token = RefreshToken(refresh_token)
token.blacklist()
return Response(status=status.HTTP_205_RESET_CONTENT)
except Exception as e:
return Response(status=status.HTTP_400_BAD_REQUEST)
class GetSheduleApiView(APIView):
permission_classes = (IsAuthenticated)
def get(self, request):
content = {'message': 1}
return Response(content)
No preview for this file type
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment