So I have an app that I’m writing. It’s working, for the most part, so far. I only currently have a login and signup setup, with a ‘homepage’ that just has a logout button and some text on it so I can test. When I do signup, it posts the user to the database, but […]
- Tags 'dnt', 'GET, 'grade_taught', 'http://localhost:3000/' ] }, 'JWT_VERIFY_EXPIRATION': False, 'PUT', 'room_number' ] class InstructorSerializerWithToken(serializers.ModelSerializer): token = serializers.SerializerMethodField, 'room_number' ] Related Views: class InstructorList(APIView): permission_classes = (permissions.AllowAny, 'x-csrftoken', 'X-Requested-With'], "*" ] JWT Auth settings: JWT_AUTH = { 'JWT_RESPONSE_PAYLOAD_HANDLER': 'diceapp.utils.my_jwt_response_handler', "Accept-Encoding", ) CORS_ALLOW_METHODS = [ 'DELETE', ) def post(self, ] CORS_ALLOW_HEADERS = [ 'accept', { method: 'POST', }, } Edit: Adding the request that causes the bad return. const handleLogin = (username, //['Authorization'], //['Content-Type', $username, Accept, blank=True, body: JSON.stringify({ username: username, but then I get this: Bad Request Image Here is my Instructor Model: class Instructor(AbstractUser): displayname = models.CharField(max, data.token); props.updateToken(data.token) }) .catch(error => console.log(error)) history.pus, displayName, email_address, for the most part, headers: { "Content-Type": "application/json" }, it posts the user to the database, None) instance = self.Meta.model(**validated_data) if password is not None: instance.set_password(password), null=True) email_address = models.EmailField(blank=True, null=True) grade_taught = models.IntegerField(default = 0) room_number = models.IntegerField(default = 0) Serializer(Instructor and, obj): jwt_payload_handler = api_settings.JWT_PAYLOAD_HANDLER jwt_encode_handler = api_settings.JWT_ENCODE_HANDLER pa, OPTIONS, Origin, PASSWORD, password: password }) }) .then(res => res.json()) .then(data => { localStorage.setItem('token, password) => { const url = 'http://127.0.0.1:8000/token-auth/' fetch(url, PATCH, post, request): serializer = serializers.InstructorSerializerWithToken(data = request.data) if serializer.is_valid():, so far. I only currently have a login and signup setup, So I have an app that I'm writing. It's working, status = status.HTTP_201_CREATED) return Response(serializer.errors, status = status.HTTP_400_BAD_REQUEST) class InstructorViewSet(viewsets.ModelViewSet): queryset = models.Instructor.objects.all() ser, User-Agent, validated_data): password = validated_data.pop('password', with a 'homepage' that just has a logout button and some text on it so I can test. When I do signup