Hi Sam,

 I'm tring to figure out how to use crypt algorithm for user password.
> looking at the code (http://code.djangoproject.com/browser/django/
> trunk/django/contrib/auth/models.py) lin 175 there is no way to use
> other than sha1.

You're right that algo='sha1' is hard coded in User.set_password().
You've a couple of options:

1. Write your own function that's a copy of User.set_password() and
uses any of the other supported algorithms. You can keep this custom
function anywhere you like (it doesn't have to be a method on User).
It would take a User instance and an algorithm as its parameters and
do what the built-in method does.

2. You can open a ticket and suggest that algo='sha1' be moved to a
keyword argument of the built-in method User.set_password so that it
can be called with other values. But before you open the ticket, wait
a day or two to let other developers comment on whether there was a
deliberate decision to not expose algo as a user controllable
parameter.

-Rajesh D

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to