Skip to main content

Modern glassmorphism & AI themes for Django admin — add one line to INSTALLED_APPS

Project description

django-admin-glass

PyPI version Python versions Django versions License: MIT

django-admin-glass is a production-ready Django admin theme package that brings modern glassmorphism and AI-inspired aesthetics to the Django admin interface — with zero template changes required.


Themes

Theme Description
liquidglass Apple WWDC 2025-inspired. Animated pastel gradient wallpaper, true glass surfaces with backdrop-filter, iridescent conic-gradient borders, specular inset highlights. Light & airy.
ai Deep space AI aesthetic. Dark blue/purple background with dot-grid SVG texture, glassmorphism cards, electric blue accent glows, vibrant purple gradients.
auto Automatically uses liquidglass on light OS preference, ai on dark. Switches live via prefers-color-scheme.

Installation

pip install django-admin-glass

Quick Start

  1. Add glass_admin before django.contrib.admin in INSTALLED_APPS:
INSTALLED_APPS = [
    "glass_admin",                   # <-- must be first
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.sessions",
    "django.contrib.messages",
    "django.contrib.staticfiles",
    # ... your apps
]
  1. (Optional) Add middleware for per-request theme access:
MIDDLEWARE = [
    # ...
    "glass_admin.middleware.GlassAdminMiddleware",
]
  1. (Optional) Set your preferred theme:
GLASS_ADMIN_THEME = "liquidglass"  # default
  1. Run collectstatic for production:
python manage.py collectstatic

That's it — visit /admin/ and enjoy your new look.


Configuration

Setting Type Default Description
GLASS_ADMIN_THEME str "liquidglass" Active theme. One of "liquidglass", "ai", or "auto".

Example configurations

# Liquid Glass (Apple-inspired, light)
GLASS_ADMIN_THEME = "liquidglass"

# AI Dark (deep space, dark)
GLASS_ADMIN_THEME = "ai"

# Auto (follows OS dark/light preference)
GLASS_ADMIN_THEME = "auto"

If an invalid value is set, glass_admin emits a UserWarning at startup and falls back to "liquidglass".


Template Tags

The glass_admin_tags library is available for advanced customization:

{% load glass_admin_tags %}

{# Render the active theme's <link> tag(s) #}
{% glass_theme_css %}

{# Render the glass_admin <script> tag #}
{% glass_js %}

{# Get the active theme name as a string #}
{% glass_theme_name %}

How It Works

django-admin-glass uses Django's standard APP_DIRS template loading. By placing glass_admin before django.contrib.admin in INSTALLED_APPS, the package's templates/admin/base_site.html takes precedence and injects the theme CSS/JS into the admin's {% block extrahead %} — no modifications to your project's templates needed.


JavaScript Features

  • Auto theme switching — live prefers-color-scheme detection for the auto theme
  • Ripple effects — glass ripple animation on submit buttons and action links
  • Toast auto-dismiss — admin success/warning/error messages fade out after 5 seconds
  • Smooth transitions — nav link hover animations

Development

git clone https://github.com/shaochun/django-admin-glass
cd django-admin-glass
pip install -e ".[dev]"
pytest tests/ -v

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss the proposed change.

  1. Fork the repo
  2. Create your feature branch (git checkout -b feature/my-feature)
  3. Commit your changes
  4. Push to the branch and open a PR

License

MIT © 2026 SC

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_admin_glass-0.1.2.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_admin_glass-0.1.2-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file django_admin_glass-0.1.2.tar.gz.

File metadata

  • Download URL: django_admin_glass-0.1.2.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for django_admin_glass-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9be92cc1dc55c4b582841f3de30929abdb3068cea63bea8d53e362eef35c336a
MD5 69f747daf982eaa93da19e99b7c354b0
BLAKE2b-256 981189a6f4b0f4e0b50e37832e4302502fafa89c8ebf1527e40763c2fe08ec04

See more details on using hashes here.

File details

Details for the file django_admin_glass-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_admin_glass-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 501a9d2f104d7a9fdf459422cf1168f4eb00b89cedb218a8d8b07e13992dfaa6
MD5 29d5eb7495c5f649fb76294d006c5d0c
BLAKE2b-256 6083689294483fd8f78bd949d77589e5c973082a6c03bf7881275f15290a8fc5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page