Assuming you want to do it the hard way, you can just use a
PasswordInput widget.
http://docs.djangoproject.com/en/1.3/ref/forms/widgets/
HTH
Jirka
It is hard for us to guess what you're actually trying to achieve.
Here are my guesses:
1) You created your own model which has nothing to do with the admin
infrastructure (i. e. the auth infrastructure used by the admin is
the default one bundled with Django). This model includes a
CharField that you want to represent in the admin using a
PasswordWidget.
In this case you'll just want to override the widget for this
specific field. (I don't know the specifics, you can look it up in
the tutorial or reference.)
2) You created a model replacing the default User model bundled in the
auth framework and are having issues with the admin login screen
using a regular TextInput for the password. This would be possible
if you specified a custom login_form to the AdminSite.
In this case you'll also want to override the widget used for this
form field to a PasswordInput.
I don't know if I guessed right but I hope it was at least a little
bit useful.
Michal Petrucha
You have to create a custom ModelForm for your Users model. This form
will only have to override the widget of the password field. Then
you'll have to create a custom ModelAdmin specifying your ModelForm
instead of the default one.
It may look something like this (note that I'm typing off the top of
my head):
class UserForm(forms.ModelForm):
class Meta:
widgets = {
'password': PasswordInput,
}
class UserAdmin(admin.ModelAdmin):
form = UserForm
admin.site.register(User, UserAdmin)
OT: Note that each time someone saves a plaintext password in a
database, a kitten dies. Please, think of the kittens. (-; (Also
applies to base64-encoded passwords and such. Yeah, you wouldn't
believe it but the academic information system our university forces
us to use does exactly that. Probably because of unicode encoding
issues.)
Michal