Skip to main content

A system/environment indicator for django

Project description

django-sys-indicator

pre-commit.ci status GitHub license GitHub issues

A visual indicator of what environment/system you're using in django.

system indicator examples

To install:

  • Add 'django_sys_indicator.apps.DjangoSysIndicatorConfig' to your INSTALLED_APPS
  • Add 'django_sys_indicator.middleware.SystemIndicatorMiddleware' to you MIDDLEWARE

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;

system indicator admin example

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-sys-indicator-2.0.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

django_sys_indicator-2.0.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file django-sys-indicator-2.0.0.tar.gz.

File metadata

  • Download URL: django-sys-indicator-2.0.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for django-sys-indicator-2.0.0.tar.gz
Algorithm Hash digest
SHA256 731f2a40e85ad382a62f0c1f3df1d239550e51b6f9122befacf89e16bb182258
MD5 211db14390eb2e21cb6e1880e6bb0ed9
BLAKE2b-256 f0e850fa7317e13e5860ff5cb7d0c7e4e5abfcb6ca533c267eed1a0d54aab371

See more details on using hashes here.

File details

Details for the file django_sys_indicator-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_sys_indicator-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49f5ca824e0f628b067000c8d6add09fca85652a6bdd5de6f5037f60331f5858
MD5 ea996ce03dd7e94d35c8b99d5a01ad71
BLAKE2b-256 22ff06e3c283996ba7e8c8fe50b2b5e81ffa0bbde500cae727120dd9eae42886

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