text: from django.contrib import admin
  from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
  
  from .forms import UserAdminCreationForm, UserAdminForm
  from .models import User
  
  class UserAdmin(BaseUserAdmin):
  
      add_form = UserAdminCreationForm
      add_fieldsets = (
          (None, {
              'fields': ('username', 'email', 'password1', 'password2')
          }),
      )
      form = UserAdminForm
      fieldsets = (
          (None, {
              'fields': ('username', 'email')
          }),
          ('Informações básicas', {
              'fields': ('name', 'last_login')
          }),
          (
              'Permissões', {
                  'fields': (
                      'is_active', 'is_staff', 'is_superuser', 'groups',
                      'user_permissions'
                  )
              }
          ),
      )
      list_display = ('username', 'name', 'email', 'date_joined', 'is_active', 'is_staff')
  
  admin.site.register(User, UserAdmin)
  
  
  