Skip to main content

Visual environment indicators for the Django admin header to distinguish Local, Dev, Stage, and Production.

Project description

django-admin-env-badge

A simple Django app that displays an environment badge in the Django admin — so you always know whether you're on Production, Staging, or Development.

Screenshots

Staging (light mode)

Staging badge

Development (dark mode)

Development badge

Production (light mode)

Production badge

Installation

pip install django-admin-env-badge

Setup

1. Add the app to INSTALLED_APPS

Place it before django.contrib.admin:

INSTALLED_APPS = [
    "django_admin_env_badge",
    "django.contrib.admin",
    # ...
]

2. Add the context processor

TEMPLATES = [
    {
        "BACKEND": "django.template.backends.django.DjangoTemplates",
        "OPTIONS": {
            "context_processors": [
                # ... default processors
                "django_admin_env_badge.context_processors.env_badge",
            ],
        },
    },
]

Configuration

Add these settings to your settings.py:

Setting Type Default Description
ADMIN_ENV_NAME str None The environment name to display. Badge is hidden when not set.
ADMIN_ENV_COLOR str "#22FE00" Badge background color (any valid CSS color).
ADMIN_ENV_ICON str "" Optional emoji shown before the name. ⚙️, 🚀, 🛠️

Example

# settings.py

ADMIN_ENV_NAME = "Production"
ADMIN_ENV_COLOR = "#0003a6"
ADMIN_ENV_ICON = "⚡"

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_env_badge-0.1.1.tar.gz (328.7 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_env_badge-0.1.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file django_admin_env_badge-0.1.1.tar.gz.

File metadata

  • Download URL: django_admin_env_badge-0.1.1.tar.gz
  • Upload date:
  • Size: 328.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.8

File hashes

Hashes for django_admin_env_badge-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f6e302ca654e181981b711e37c75980af5a805dd0a02b9f3be98eca590d0484e
MD5 991694977e72b1bfaef6b2841cb5e470
BLAKE2b-256 29eb1e9a5d1f1039b22ac92c9d2a607307bb92e35f96430c6169ece32438fcf8

See more details on using hashes here.

File details

Details for the file django_admin_env_badge-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_admin_env_badge-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b912e13606dc2f364ec02a51c29cdb5bdb93c5f2b6528a9afbee4928b8acee30
MD5 926b77f5a10dbf965d0b9b5591744e2c
BLAKE2b-256 47fe322cd8f2d170b18cc39bb861d532147c93c8326097c276f7f3799b15963b

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