In this context it means that you shouldn’t encrypt, hash or otherwise manipulate the password before passing it into the method.
Django, many other packages and Python itself will accept objects that can be coerced into a string (via __str__) rather than throw an exception. We’re all consenting adults here - if you want to pass a non-string object into “make_password” then that’s up to you. The question really is if this is a common enough mistake to warrant a guard against strange input. I’d say no, however a small change to the documentation might be in order. Tom > On 12 Mar 2020, at 17:41, Dawid Czeluśniak <czelusniakda...@gmail.com> wrote: > > Adam, > > If it's perfectly fine to pass almost any not-None object to make_password > function and it returns correctly generated hash then why does the > documentation say: > > make_password(password, salt=None, hasher='default') > Creates a hashed password in the format used by this application. It takes > one mandatory argument: the password in plain-text. > > https://docs.djangoproject.com/en/3.0/topics/auth/passwords/#django.contrib.auth.hashers.make_password > > <https://docs.djangoproject.com/en/3.0/topics/auth/passwords/#django.contrib.auth.hashers.make_password> > > What does "plain-text" mean there? > > Thanks, > Dawid > > > > On Thursday, 12 March 2020 18:18:59 UTC+1, Adam Johnson wrote: > User provided passwords are validated already: > https://docs.djangoproject.com/en/3.0/topics/auth/passwords/#module-django.contrib.auth.password_validation > > <https://docs.djangoproject.com/en/3.0/topics/auth/passwords/#module-django.contrib.auth.password_validation> > > When using set_password directly, you as the programmer are responsible for > ensuring the value you use for password is valid. Normally this means calling > the functions detailed in "Integrating validation" beforehand. > > -- > Adam > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-developers+unsubscr...@googlegroups.com > <mailto:django-developers+unsubscr...@googlegroups.com>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-developers/bda75e4c-2dae-42ef-91f3-c3054031c800%40googlegroups.com > > <https://groups.google.com/d/msgid/django-developers/bda75e4c-2dae-42ef-91f3-c3054031c800%40googlegroups.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/0E23455A-7EED-4EE5-AA90-8763BA68E5D7%40tomforb.es.