Skip to main content

tungsten-environment-indicator

A Local / Staging / Live badge for Tungsten admin panels, so nobody changes live data by mistake.

What you get

  • A colored badge in the top bar: green Local, blue Development, amber Staging, red Live.
  • A thin colored line on top of every page, sign-in page too.
  • The browser tab title starts with [Live], [Staging]... so you can tell tabs apart.
  • "You are signing in to Live" on the sign-in page.
  • Optional git branch in the badge (read from .git/HEAD, no command runs).
  • A debug on warning when a live app runs with FastAPI(debug=True).
  • Show it only to some users (for example admins), or hide it on live for a customer panel.
  • AI assistants using the MCP plugin are told when the panel is live.

Install

pip install tungsten-environment-indicator
from tungsten_environment_indicator import EnvironmentIndicatorPlugin

panel.plugin(EnvironmentIndicatorPlugin())

Then set the environment where your app runs:

APP_ENV=staging uvicorn app:app

It reads TUNGSTEN_ENV, APP_ENV, ENVIRONMENT, ENV, FASTAPI_ENV or PYTHON_ENV (first one set wins). prod and live mean production, stage and uat mean staging, dev means development.

With none of them set, a panel opened on localhost or 127.0.0.1 shows Local, and anything else shows Live. Behind a proxy (nginx, Apache) it only says Local when the forwarded host is local too. So a forgotten setting never hides the Live warning.

Options

EnvironmentIndicatorPlugin(
    environment="staging",                  # or a function; None = detect
    labels={"production": "Production"},    # text per environment
    colors={"staging": "orange", "qa": "#0ea5e9"},
    visible=lambda user: user.is_admin,     # or True / False
    hide_in=("production",),                # show nothing on live
    git_branch=True,
    badge=True, border=True, title_prefix=True, login=True,
    border_width=3,
)

Colors are names (red, amber, green, blue, violet, danger, warning, success...) or hex like #0ea5e9. A wrong color stops the app at start-up, so you see the typo at once.

For other plugins

from tungsten_environment_indicator import environment_of

env = environment_of(panel, ctx)      # None when this plugin is not installed
if env and env.is_production:
    ...
plugin = panel.get_plugin("environment-indicator")
plugin.badge(ctx, size="lg")          # the same badge, as HTML

Environment has name, label, color, text_color, branch, debug and is_production.

Docs: https://tungsten.prisminfoways.com/docs/environment-indicator

Metadata

Release files for tungsten-environment-indicator 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tungsten-environment-indicator 0.1.0
File Size Uploaded Provenance Actions
tungsten_environment_indicator-0.1.0.tar.gz 12.8 kB Without provenance Details for tungsten_environment_indicator-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tungsten-environment-indicator 0.1.0
File Interpreter ABI Platform Actions
tungsten_environment_indicator-0.1.0-py3-none-any.whl Python 3 none any Details for tungsten_environment_indicator-0.1.0-py3-none-any.whl

Total release size: 23.2 kB

Release files / tungsten_environment_indicator-0.1.0.tar.gz

Download URL tungsten_environment_indicator-0.1.0.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3dd95880b2f218b01f2688669b51de33304418abbd0263fa6b1bfdaf17408979
BLAKE2b-256 checksum
How to use checksums
94688ecdecf40409f0aa816617b3fde3260d2903f666d1d4e1291b342d531a00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tungsten_environment_indicator-0.1.0-py3-none-any.whl

Download URL tungsten_environment_indicator-0.1.0-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9f3eb9768ced8834dd66ccf889c66124f6ed2b9ceb0782b7db52ddc8015ca12d
BLAKE2b-256 checksum
How to use checksums
c7ec24453a70641fc52b90468c1ba9feb893243b11ae9a8d349eda1c50a50e32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for tungsten-environment-indicator 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page