Modified files
app/admin.py
---
+++
@@ -1,4 +1,5 @@
from django.contrib import admin
+from django.contrib.auth.admin import UserAdmin
from app.models import Article, UserProfile
@@ -11,5 +12,24 @@
readonly_fields = ("word_count", "created_at", "updated_at")
+class CustomUserAdmin(UserAdmin):
+ fieldsets = (
+ (None, {"fields": ("email", "password")}),
+ ("Personal info", {"fields": ("first_name", "last_name")}),
+ ("Permissions", {"fields": ("is_active", "is_staff", "is_superuser", "groups", "user_permissions")}),
+ ("Important dates", {"fields": ("last_login", "date_joined")})
+ )
+ add_fieldsets = (
+ (None, {
+ "classes": ("wide",),
+ "fields": ("email", "password1", "password2")
+ }),
+ )
+ list_display = ("email", "is_staff", "is_active")
+ list_filter = ("is_staff", "is_active")
+ search_field = ("email",)
+ ordering = ("email",)
+
+
admin.site.register(Article, ArticleAdmin)
-admin.site.register(UserProfile)+admin.site.register(UserProfile, CustomUserAdmin)