# Panel Admin

I will sharing costomize panel adming using \`jazzmin\`

adding `jazzmin`

dalam install app seeting.py

<figure><img src="https://695498858-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89GYZ7bCFBFFAobNJ6x5%2Fuploads%2FDOVSxEV7U6rK06hvEbLI%2Fimage.png?alt=media&#x26;token=434d2773-1f21-41bb-85ea-1e3da68973c2" alt=""><figcaption></figcaption></figure>

Error, karena database belum di migrate..

<figure><img src="https://695498858-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89GYZ7bCFBFFAobNJ6x5%2Fuploads%2FUc0xylXgUXuxsWJtQMos%2Fimage.png?alt=media&#x26;token=44069b69-8e31-400f-9482-7d2e0b834fbb" alt=""><figcaption></figcaption></figure>

`python manage.py migrate`

## Create Super User

```
// Some code
python manage.py createsuperuser
```

Lanjutkan untuk isi

```
// Some code
(venv) PS D:\REACT NATIVE\DJANGO\blogreact\backend> python manage.py createsuperuser
Username (leave blank to use 'legion'): admin
Email address: andi@gmail.com
Password:
Password (again):
Superuser created successfully.
(venv) PS D:\REACT NATIVE\DJANGO\blogreact\backend> python manage.py runserver      
```

Dan silahkan login dengan akun super user..

<figure><img src="https://695498858-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89GYZ7bCFBFFAobNJ6x5%2Fuploads%2Fc6P11Mzt4hlb6gducajE%2Fimage.png?alt=media&#x26;token=fc0df48d-fdaf-4546-aa76-9afcaf5e4035" alt=""><figcaption></figcaption></figure>

Disini saya akan berikan costume dari jazzmin project saya.

```
// Some code

# Custom Admin Settings
JAZZMIN_SETTINGS = {
    "site_title": "Desphixs",
    "site_header": "Desphixs",
    "site_brand": "Modern Marketplace ",
    # "site_icon": "images/favicon.ico",
    # "site_logo": "images/logos/logo.jpg",
    "welcome_sign": "Welcome To Desphixs",
    "copyright": "Desphixs",
    "user_avatar": "images/photos/logo.jpg",
    "topmenu_links": [
        {"name": "Dashboard", "url": "home", "permissions": ["auth.view_user"]},
        {"model": "auth.User"},
    ],
    "show_sidebar": True,
    "navigation_expanded": True,
    "order_with_respect_to": [
        "api",
        "api.Post",
        "api.Category",
        "api.Comment",
        "api.Bookmark",
        "api.Notification",
    ],
    "icons": {
        "admin.LogEntry": "fas fa-file",

        "auth": "fas fa-users-cog",
        "auth.user": "fas fa-user",

        "api.User": "fas fa-user",
        "api.Profile":"fas fa-address-card",
        "api.Post":"fas fa-th",
        "api.Category":"fas fa-tag",
        "api.Comment":"fas fa-envelope",
        "api.Notification":"fas fa-bell",
        "api.Bookmark":"fas fa-heart",

        
    },
    "default_icon_parents": "fas fa-chevron-circle-right",
    "default_icon_children": "fas fa-arrow-circle-right",
    "related_modal_active": False,
    
    "custom_js": None,
    "show_ui_builder": True,
    
    "changeform_format": "horizontal_tabs",
    "changeform_format_overrides": {
        "auth.user": "collapsible",
        "auth.group": "vertical_tabs",
    },
}

# Jazzmin Tweaks

JAZZMIN_UI_TWEAKS = {
    "navbar_small_text": False,
    "footer_small_text": False,
    "body_small_text": True,
    "brand_small_text": False,
    "brand_colour": "navbar-indigo",
    "accent": "accent-olive",
    "navbar": "navbar-indigo navbar-dark",
    "no_navbar_border": False,
    "navbar_fixed": False,
    "layout_boxed": False,
    "footer_fixed": False,
    "sidebar_fixed": False,
    "sidebar": "sidebar-dark-indigo",
    "sidebar_nav_small_text": False,
    "sidebar_disable_expand": False,
    "sidebar_nav_child_indent": False,
    "sidebar_nav_compact_style": False,
    "sidebar_nav_legacy_style": False,
    "sidebar_nav_flat_style": False,
    "theme": "default",
    "dark_mode_theme": None,
    "button_classes": {
        "primary": "btn-outline-primary",
        "secondary": "btn-outline-secondary",
        "info": "btn-info",
        "warning": "btn-warning",
        "danger": "btn-danger",
        "success": "btn-success"
    }
}
```

<figure><img src="https://695498858-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89GYZ7bCFBFFAobNJ6x5%2Fuploads%2FCb7wBwd7LYrubKqltXWF%2Fimage.png?alt=media&#x26;token=6667c112-0976-4b3e-becb-f31f01b94cb7" alt=""><figcaption></figcaption></figure>
