django-rest-frameworkdjango-rest-framework-jwtdjango-rest-framework-simplejwt

How can i use Simple JWT for custom User Model


I am managing my User Model (for customers), but i don't know how can i use simple-jwt for my Customer Model with it's custom Login View.

models.py

from django.db import models

class Customer(models.Model):
   name = models.CharField(max_length=100)
   email = models.EmailField(max_length=100)
   password = models.CharField(max_length=100)

and also, i want to manage my customer session by saving the Refresh Token, can anyone please tell me how can i achieve that.


Solution

  • After some research, I came to the conclusion that Simple JWT doesn't have any special support for user models that are not derived from AbstactUserModel.

    It means if you are managing the Customer model, either you need to extend it from AbstactUserModel or you should use jwt instead of Simple jwt.