text: 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 accounts.models import MyUser, UserProfile
  from accounts.forms import UserChangeForm, UserCreationForm
  
  class UserAdmin(BaseUserAdmin):
      # The forms to add and change user instances
      form = UserChangeForm
      add_form = UserCreationForm
  
      # The fields to be used in displaying the User model.
      # These override the definitions on the base UserAdmin
      # that reference specific fields on auth.User.
      list_display = ('username', 'email', 'is_admin', 'is_member')
      list_filter = ('is_admin', 'is_member', 'is_active')
      fieldsets = (
          (None, {'fields': ('email', 'password')}),
          ('Personal info', {'fields': ('first_name', 'last_name')}),
          ('Permissions', {'fields': ('is_admin', 'is_member', 'is_active')}),
      )
      # add_fieldsets is not a standard ModelAdmin attribute. UserAdmin
      # overrides get_fieldsets to use this attribute when creating a user.
      add_fieldsets = (
          (None, {
              'classes': ('wide',),
              'fields': ('first_name', 'last_name', 'username', 'email', 'password1', 'password2')}
          ),
      )
      search_fields = ('email', 'username', 'first_name', 'last_name')
      ordering = ('email',)
      filter_horizontal = ()
  
  # Now register the new UserAdmin...
  admin.site.register(MyUser, UserAdmin)
  
  admin.site.register(UserProfile)
  # ... and, since we're not using Django's built-in permissions,
  # unregister the Group model from admin.
  #admin.site.unregister(Group)
  