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_user manager method when creating users.
If you're creating custom forms, subclass one of the UserCreationForm or UserChangeForm. If you're creating a custom ModelAdmin, then subclass UserAdmin. 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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With