text: from django.contrib import admin
  
  
  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 .forms import UserChangeForm, UserCreationForm
  from .models import MyUser, Profile, ActivationProfile
  
  
  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')
      list_filter = ('is_admin',)
      fieldsets = (
          (None, {'fields': ('username', 'email', 'password')}),
          ('Personal info', {'fields': ('zipcode',)}),
          ('Permissions', {'fields': ('is_admin', 'is_staff',)}),
          ('Access', {'fields': ('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': ('username', 'email', 'password1', 'password2')}
          ),
      )
      search_fields = ('username', 'email',)
      ordering = ('username', 'email',)
      filter_horizontal = ()
  
  
  admin.site.register(MyUser, UserAdmin)
  
  admin.site.register(Profile)
  
  admin.site.register(ActivationProfile)
  
  
  # ... and, since we're not using Django's built-in permissions,
  # unregister the Group model from admin.
  admin.site.unregister(Group)
  
  
  
  