Hi im new to django and python, i want to make API to add user and it worked but when i try login with it but the result is i cant login, seems like it must hash password for system can read the user, and i try to hash my password in model.
heres my model :
from django.contrib.auth.hashers import make_password
class MyUser(AbstractUser):
pass
password = models.CharField(max_length=128, null=False)
def save(self, *args, **kwargs):
self.password = make_password(self.password)
but its make id become null heres the screenshot of result when i use make_passwod and not:
screenshot when make_password not added
screenshot when make_password added
im following this tutorial with a bit modification heres the link django-rest-framework-create-api
cause the id null the data not saved to database. So the question how to add the id ? why the id become null when i add make_password ? or maybe i am missing something ?
thank you in advance