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.1.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: django-sys-indicator-2.1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for django-sys-indicator-2.1.0.tar.gz
Algorithm Hash digest
SHA256 f1298b4ca382451fd4bc45390a491100bc0f52177ce77cad51fd150ed7801517
MD5 5e26099002b94fef47c3600c9732cf8b
BLAKE2b-256 d3aa887ed189dd430bc65382addfb95499b350d2a9f61bae5c4277a408d51305

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for django_sys_indicator-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e5f1fa96b88a01f553bf1702c945f127ace2187a1ea4913b453f4897aece6e2a
MD5 89e3c00be680b670ce3129108f2b6e47
BLAKE2b-256 a62d1f0d10b1ce6ac0b2a20cc33b2678ad8ab80a2cfdc003a652f5c47dc846a6

See more details on using hashes here.

Provenance

Supported by

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