Adding Password Hashing Feature to the CustomUser(AbstractUser).

I’m working on integrating password hashing support for CustomUser(AbstractUser) in the admin panel without manual configuration. I need guidance on code logic and how to handle dynamic admin registrations for CustomUser(AbstractUser). Any advice would be greatly appreciated from mentors, especially @adamchainz and @sarahboyce

Check out the video demo covering both scenarios: Demo (New Feature starts from 2:45)

If you found this idea useful then I’ll create PR against this feature.

Feel free to reach out:
Email
LinkedIn

I don’t quite understand what you’re trying to do from your description or video. Can you provide a write-up or a link to the ticket?

I particularly don’t find the video easy to follow - I see form submissions but there’s no commentary on what you’re doing.

I apologize @adamchainz if my recorded video didn’t clearly convey my intentions. Unfortunately, I lack a proper setup for video recording. :slightly_smiling_face:
Anyway, I’d like to provide a brief overview of what I’m trying to achieve.

When we create a custom user by inheriting from the AbstractUser class in Django, we face certain limitations in user management:

  1. We need to manually register our User model in the admin.py file, as with other models.
  2. Upon user registration, there’s no provision to save or change the user password securely. Moreover, there are no password validations in place, and the password is stored in plain text. :smiling_face_with_tear: This is demonstrated in my video from 00:00 to 2:40.

What I have implemented:

  1. Once we define AUTH_USER_MODEL in the settings.py file, there’s no need to register the Custom User in admin.py.
  2. Without any additional configuration, the CustomUser model now supports secure password storage with validations and hashing, as demonstrated from 2:45 onwards in the video. :grinning:

If you permit, I would like to create a Draft PR against this feature for further discussion and clarification. :handshake: