old_contents: from django import forms
  from django.contrib import admin
  from django.contrib.auth.models import Group
  from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
  from django.contrib.auth.forms import ReadOnlyPasswordHashField
  
  from .models import Account
  
  
  class UserCreationForm(forms.ModelForm):
      password1 = forms.CharField(label='Password', widget=forms.PasswordInput)
      password2 = forms.CharField(label='Password confirmation', widget=forms.PasswordInput)
  
      class Meta:
          model = Account
          fields = ('username', 'email', 'name')
  
      def clean_password2(self):
          password1 = self.cleaned_data.get("password1")
          password2 = self.cleaned_data.get("password2")
          if password1 and password2 and password1 != password2:
              raise forms.ValidationError("패스워드가 동일하지 않습니다.")
          return password2
  
      def save(self, commit=True):
          # Save the provided password in hashed format
          user = super(UserCreationForm, self).save(commit=False)
          user.set_password(self.cleaned_data["password1"])
          if commit:
              user.save()
          return user
  
  
  class UserChangeForm(forms.ModelForm):
      password = ReadOnlyPasswordHashField()
  
      class Meta:
          model = Account
          fields = ('username', 'email', 'name', 'password')
  
      def clean_password(self):
          return self.initial["password"]
  
  
  class UserAdmin(BaseUserAdmin):
      form = UserChangeForm
      add_form = UserCreationForm
  
      list_display = ('username', 'email', 'name', 'is_admin')
      list_filter = ('is_admin',)
      fieldsets = (
          (None, {'fields': ('username', 'password')}),
          ('Personal info', {'fields': ('email', 'name', )}),
          ('Permissions', {'fields': ('is_admin',)}),
      )
  
      add_fieldsets = (
          (None, {
              'classes': ('wide',),
              'fields': ('username', 'email', 'name', 'password1', 'password2')}
          ),
      )
      search_fields = ('username',)
      ordering = ('username',)
      filter_horizontal = ()
  
  
  admin.site.register(Account, UserAdmin)
  admin.site.unregister(Group)
  
new_contents: from django import forms
  from django.contrib import admin
  from django.contrib.auth.models import Group
  from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
  from django.contrib.auth.forms import ReadOnlyPasswordHashField
  
  from .models import Account
  
  
  class UserCreationForm(forms.ModelForm):
      password1 = forms.CharField(label='Password', widget=forms.PasswordInput)
      password2 = forms.CharField(label='Password confirmation', widget=forms.PasswordInput)
  
      class Meta:
          model = Account
          fields = ('username', 'email', 'name')
  
      def clean_password2(self):
          password1 = self.cleaned_data.get("password1")
          password2 = self.cleaned_data.get("password2")
          if password1 and password2 and password1 != password2:
              raise forms.ValidationError("패스워드가 동일하지 않습니다.")
          return password2
  
      def save(self, commit=True):
          # Save the provided password in hashed format
          user = super(UserCreationForm, self).save(commit=False)
          user.set_password(self.cleaned_data["password1"])
          if commit:
              user.save()
          return user
  
  
  class UserChangeForm(forms.ModelForm):
      password = ReadOnlyPasswordHashField()
  
      class Meta:
          model = Account
          fields = ('username', 'email', 'name', 'password')
  
      def clean_password(self):
          return self.initial["password"]
  
  
  class UserAdmin(BaseUserAdmin):
      form = UserChangeForm
      add_form = UserCreationForm
  
      list_display = ('username', 'email', 'name', 'is_admin', 'is_superuser')
      list_filter = ('is_admin',)
      fieldsets = (
          (None, {'fields': ('username', 'password')}),
          ('Personal info', {'fields': ('email', 'name', )}),
          ('Permissions', {'fields': ('is_admin', 'is_superuser', 'is_active')}),
      )
  
      add_fieldsets = (
          (None, {
              'classes': ('wide',),
              'fields': ('username', 'email', 'name', 'password1', 'password2')}
          ),
      )
      search_fields = ('username',)
      ordering = ('username',)
      filter_horizontal = ()
  
  
  admin.site.register(Account, UserAdmin)
  admin.site.unregister(Group)
  
subject: Add some fields for display