django : user admin

◾️ user admin with admin panel

from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from . import models


# Register your models here.
# https://docs.djangoproject.com/en/3.2/ref/contrib/admin/
@admin.register(models.User)
class CustomUserAdmin(UserAdmin):
    """ Custom User Admin """

    fieldsets = UserAdmin.fieldsets + (
        (
            "Custom Profile",
            {
                "fields": (
                    "avatar",
                    "gender",
                    "bio",
                    "birthday",
                    "language",
                    "currency",
                    "superhost",
                )
            },
        ),
    )

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です