Also, there's the create_superuser() method.

On Fri, 15 Mar 2019 at 01:48, Peter of the Norse <rahmc...@gmail.com> wrote:

> The biggest difference is that when you call create_user, it creates a
> hash of the password.  Eventually, create_user does call create, but only
> after setting all the values properly.
>
> Sent from my iPad
>
> On Feb 17, 2019, at 4:30 AM, Maarten Nieber <mnie...@gmail.com> wrote:
>
> Hi,
>
> the Django guidelines tell us to implement CustomUserManager.create_user.
> However, this seems to introduce some ambiguity between
> CustomUserManager.create_user and CustomUserManager.create, since both
> these methods can be expected to create a User. In fact,
> it would be easy to accidentically call the wrong method from source code.
>
> Is there any reason why the create_user function exists at all? Why
> doesn't Django tell us to override CustomUserManager.create?
>
> Or alternatively, I could imagine that Django could have a hook function
> that is called by CustomUserManager.create, where the hook can be used
> to implemented custom behaviour (so that at least we have only 1 function
> to create users). Would this be a better design? Or is the current
> design the correct one, and am I missing something? (in that case, please
> elaborate)
>
> Best regards,
> Maarten
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b934b1a4-a295-4e83-be9c-b787785e5fc6%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/b934b1a4-a295-4e83-be9c-b787785e5fc6%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/E560F7DD-84E1-485F-92E4-D89E9240188D%40gmail.com
> <https://groups.google.com/d/msgid/django-users/E560F7DD-84E1-485F-92E4-D89E9240188D%40gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFmXjSAdttiALjucO2OiSZX54GJOVQ4VvZQ3pX4yKDEgzsm46g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to