A visual indicator of what environment/system you're using in django.
To install:
- Add
"django_sys_indicator.apps.DjangoSysIndicatorConfig"to yourINSTALLED_APPS - Add
"django_sys_indicator.middleware.SystemIndicatorMiddleware"to yourMIDDLEWARE
Configuration settings and their defaults
SYSTEM_INDICATOR_ENABLED = False
SYSTEM_INDICATOR_LABEL = "localhost"
SYSTEM_INDICATOR_COLORS = {
# Format here is colour, border colour
"red": ("#c50000", "#daa"),
"blue": ("#006fc4", "#aad"),
"green": ("#009e00", "#ada"),
"purple": ("#800080", "#dad"),
"orange": ("#ff7700", "#ffb57d"),
}
SYSTEM_INDICATOR_COLOR = "red"
SYSTEM_INDICATOR_EXCLUSIONS = []
To exclude paths, include regex in SYSTEM_INDICATOR_EXCLUSIONS
import re
SYSTEM_INDICATOR_EXCLUSIONS = [
re.compile("^/[^/]+/admin/.\*$"),
]
Example of a localhost indicator in admin;

