I’ve using django 1.4. When creating a new user, it saves plain password. Is there a setting for it so when saving a user, the password is saved encrypted?
EDIT
I’m simply using the built-in admin functionality to add a user. Nothing fancy – just the built in auth module and the user form that is automatically created in admin.
More Edit
I required some custom field so I’ve used a custom class:
class UserForm(forms.ModelForm):
class Meta:
model = User
...
...
You should use the
create_usermanager method when creating users.If you’re creating custom forms, subclass one of the
UserCreationFormorUserChangeForm. If you’re creating a customModelAdmin, then subclassUserAdmin. Otherwise you’ll have to re-implement the password hashing functionality yourself.Note that the password will be hashed, not encrypted (i.e. you can’t decrypt it).