django admin
- Repo stars 0
- Author repo skills-registry
- Domain
- Design
- Author-declared agents
- No explicit declaration found; this is not inferred or tested compatibility
- Static check
- 88 / 100 · heuristic scan, not runtime safety proof
- Runtime evidence
- Not run; no isolated runtime test evidence is currently recorded
- Author / version / license
- @tomevault-io · no license declared
- Token usage
- Lean
- Setup complexity
- Plug-and-play
- External API key
- Not required
- Operating systems
- Unspecified (assume cross-platform)
- Runtime requirements
- Python
- Detected file/system behavior
-
- Read-only
- Write / modify
- Network behavior
- Local-only
- Install commands
- None (reference only)
Heads up: Tool permissions are not declared; actual access depends on the runtime.
# Django Admin — Nudge
## Branding
The admin is branded to match Nudge's zinc-neutral + yellow-accent palette via a custom template:
`backend/templates/admin/base_site.html`
This template:
- Extends `admin/base.html` (NOT `admin/base_site.html` — that would loop)
- Overrides Django's CSS variables for both light and dark mode
- Sets the "Nudge" logo linking to `/` (the app, not `/admin/`)
- Forces white text on dark headers in all theme modes
- Repaints the "save" (default) submit button with the brand yellow (`#fcd34d`) so the primary CTA matches the app
### Color palette
Mirrors `frontend/src/index.css` — **source of truth lives there**. If it changes, update this template too.
| Token | Light | Dark |
|-----------------|------------|------------|
| Primary (text / bg dark) | `#18181b` | `#fafafa` |
| Primary hover | `#27272a` | `#e4e4e7` |
| Accent (brand) | `#fcd34d` | `#fcd34d` |
| Body bg | `#fafafa` | `#0a0a0b` |
| Surface | `#ffffff` | `#18181b` |
| Border | `#e4e4e7` | `#27272a` |
| Link | `#09090b` | `#fafafa` |
| Link hover | `#27272a` | `#fcd34d` |
### Django CSS variables to override
The key to theming Django admin is overriding its own CSS custom properties:
`--header-bg`, `--module-bg`, `--link-fg`, `--button-bg`, `--breadcrumbs-bg`, etc.
Do this for `:root`, `html[data-theme="light"]`, `html[data-theme="dark"]`,
and `@media (prefers-color-scheme: dark)` with `:root:not([data-theme="light"])`.
## Admin access from the PWA
The frontend has an "Admin" button (staff users only) in the Header component.
It works by creating a hidden form that POSTs the JWT token to `/api/auth/admin-access/`.
The backend view (`apps.users.views.admin_access`):
- Is `@csrf_exempt` (no CSRF token available from the SPA)
- Validates the JWT, checks `is_staff`
- Creates a Django session via `django_login()`
- Redirects to `/admin/`
## i18n
Django admin is multilingual out of the box. We enabled it by:
- Adding `django.middleware.locale.LocaleMiddleware` to `MIDDLEWARE`
(after `SessionMiddleware`, before `CommonMiddleware`)
- Setting `LANGUAGES = [("en", "English"), ("es", "Español"), ("gl", "Galego")]`
The admin auto-detects language from the browser's `Accept-Language` header.
## Registering models
Pattern used in `apps/users/admin.py`:
```python
@admin.register(User)
class UserAdmin(BaseUserAdmin):
fieldsets = BaseUserAdmin.fieldsets + (
("Nudge settings", {"fields": ("timezone", "daily_notification_time", "language")}),
)
list_display = ["username", "email", "timezone", "is_staff", "is_active"]
list_filter = ["is_staff", "is_active", "timezone"]
search_fields = ["username", "email"]
```
---
> Source: [cibrandocampo/nudge](https://github.com/cibrandocampo/nudge) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-22 -->
Sections and files
Listed in source order.
sections -> Branding → Color palette → Django CSS variables to override → Admin access from the PWA → i18n → Registering models
terms -> source of truth lives there · Mirrors frontend/src/index.css — source of truth lives there. · The frontend has an "Admin" button (staff users only) in the Header component. · Django admin is multilingual out of the box. · The admin auto-detects language from the browser's Accept-Language header. · --- > Source: [cibrandocampo/nudge](https://github.com/cibrandocampo/nudge) — distributed by [TomeVault](https://tomevault.io).
files/cmd -> backend/templates/admin/base_site.html · admin/base.html · admin/base_site.html · (the app, not · #fcd34d · frontend/src/index.css · #18181b · #fafafa
body sha256 -> b816874a291c
Branding
The admin is branded to match Nudge's zinc-neutral + yellow-accent palette via a custom template:
backend/templates/admin/base_site.htmlThis template: Extendsadmin/base.html(NOTadmin/base_site.html— that would loop) Overrides Django's CSS variables for both light and dark modeColor palette
Mirrors
frontend/src/index.css— source of truth lives there. If it changes, update this template too. Token · Light · Dark Primary (text / bg dark) ·#18181b·#fafafaPrimary hover ·#27272a·#e4e4e7Accent (brand) ·#fcd34d·#fcd34dDjango CSS variables to override
The key to theming Django admin is overriding its own CSS custom properties:
--header-bg,--module-bg,--link-fg,--button-bg,--breadcrumbs-bg, etc. Do this for:root,html[data-theme="light"],html[data-theme="dark"], and@media (prefers-color-scheme: dark)with:root:not([data-theme="light"]).Admin access from the PWA
The frontend has an "Admin" button (staff users only) in the Header component. It works by creating a hidden form that POSTs the JWT token to
/api/auth/admin-access/. The backend view (apps.users.views.admin_access): Is@csrf_exempt(no CSRF token available from the SPA) Validates the JWT, checksis_staffi18n
Django admin is multilingual out of the box. We enabled it by: Adding
django.middleware.locale.LocaleMiddlewaretoMIDDLEWARE(afterSessionMiddleware, beforeCommonMiddleware) SettingLANGUAGES = [("en", "English"), ("es", "Español"), ("gl", "Galego")]The admin auto-detects language from the browser'sAccept-Languageheader.