text: from django.contrib import admin
  from django.contrib.auth.admin import UserAdmin
  from django.utils.translation import ugettext_lazy as _
  from django.contrib.auth import get_user_model
  
  from .models import User
  
  
  class CustomUserAdmin(UserAdmin):
      """Define admin model for custom User model with no username field."""
      fieldsets = (
          (None, {'fields': ('username', 'email', 'password')}),
          (_('Personal info'), {'fields': ('first_name', 'last_name')}),
          (_('Permissions'), {'fields': ('is_active', 'is_staff', 'is_superuser',
                                         'groups', 'user_permissions')}),
      )
      add_fieldsets = (
          (None, {
              'classes': ('wide',),
              'fields': ('username', 'email', 'password1', 'password2'),
          }),
      )
      list_display = ('username', 'email', 'first_name', 'last_name',
                      'is_staff')
      search_fields = ('username', 'email', 'first_name', 'last_name')
      ordering = ('username',)
  
  
  admin.site.register(get_user_model(), CustomUserAdmin)
  