Another approach is to use signals. In models.py
from django.dispatch import dispatcher
from django.contrib.auth.models import User
def user_save(instance):
if not instance.password.startswith('sha1$'):
instance.set_password(instance.password)
return
dispatcher.connect(user_save,
On 07-Jul-06, at 11:11 PM, keukaman wrote:
> Also, I'm unsure what "Use '[algo]$[salt]$[hexdigest]'" means just
> below the password field when setting up the account.
at python prompt:
import md5
passwd = md5.new('yourpassword').hexdigest()
print passwd
cut and paste the result in the passwd
You can add this to one of your models.py to get a behaviour close to
what you're describing:
from django.contrib.auth.models import User
def user_save(self):
if not self.password.startswith('sha1$'):
self.set_password(self.password)
super(User, self).save()
User.save = user_save
Thanks. I took a shortcut and pasted the hash from the superuser into
each account. Then I went into each and used the "change password"
link. This created a hash for each.
It seems that it would be easier when creating a user through the admin
to create a user friendly password which is then tr
On 7/7/06, keukaman <[EMAIL PROTECTED]> wrote:
> Also, I'm unsure what "Use '[algo]$[salt]$[hexdigest]'" means just
> below the password field when setting up the account.
Based on that, I assume you've put the actual password in the
database. Instead, django expects a hash of the actual passwor
5 matches
Mail list logo