Search code examples
djangodjango-authenticationdjango-registration

Trouble understanding Django-regustration-redux


What model does the django-registration-redux uses to store the info about the registered user ?

And, I can even login my superuser account through the interface provided by the registration-redux (http://127.0.0.1:8000/accounts/login). How is this possible ?


Solution

  • django-registeration-redux uses the base user model to store information about users.

    The code below is from https://raw.githubusercontent.com/macropin/django-registration/master/registration/users.py

    from django.conf import settings
    from django.contrib.auth import get_user_model
    
    UserModel = get_user_model
    

    This is what is imported and used here: https://github.com/macropin/django-registration/blob/master/registration/models.py#L90-L105

    Technically, all the users are instances of this base user model so your superuser account is no different and should be able to login unless you have written some custom code to prevent superusers to be unable to login.