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.0.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.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_admin_glass-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 a19c2f45958d118c0d299a7f030f82ea42355670c801118fcf6da8c7905d2052
MD5 b346d2f1a5e30959f4d1c49be1445d7a
BLAKE2b-256 8dde736b63d3307124aa8d2a4cefb098d19e9c3ce47c20f9e913644115699ef7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_admin_glass-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6d6061ff0e4dc7f67bcf3dfb3b7aa1e35c72ad0c26599887bef4793f5ef351df
MD5 7118a226a7926dc3b23cb1a339db63b3
BLAKE2b-256 250ad7b0644996bc66d930aa1d0fab1d8cdf11ae379dc4b5b3913bc8c8b38918

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