Skip to main content

Lightweight set of middleware classes that inject visual indicators for each type of environment that a project isdeployed to.

Project description

Introduction

Lightweight set of middleware classes that inject visual indicators for each type of environment that a project is deployed to. Inspired by this article.

http://i.imgur.com/5n9gFbn.png

Quickstart

  1. Install the package: pip install django-envi.

  2. Add the 'envi' app to your INSTALLED_APPS.

  3. Install the desired middleware class to MIDDLEWARE_CLASSES: * envi.middleware.EnviFooterMiddleware injects a sticky footer to all pages that displays the current environment.

  4. In each environment’s settings file, add the ENVIRONMENT_KEY setting, with the corresponding environment key string. See below.

Built-in environments

There are a number of built-in environment definitions:

  • 'local': A striped grey banner. Appears site-wide (_default_).

  • 'dev': A striped blue banner. Appears site-wide.

  • 'staging': A striped yellow banner. Appears site-wide.

  • 'production': A striped red banner. Only appears in /admin.

Configuration

The following settings are supported in your settings.py:

  • ENVI_ENVIRONMENT_KEY: TODO

    • Default: 'local'

  • ENVI_ENVIRONMENTS: TODO

  • ENVI_ENVIRONMENT: The current environment. This can either be defined explicitly (see below), otherwise it will be set to the corresponding dictionary by looking up the ENVI_ENVIRONMENT_KEY within the ENVI_ENVIRONMENTS dictionary.

Creating environments

TODO: How to.

Advanced usage

The implementation of django-envi makes it easy to customize.

Extending via templates

TODO: How to.

Extending via subclassing

TODO: How to.

Changelog

Version

Description

0.2

Repackaged without unnecessary docs/images directory. All documentation can be found in README.rst.

0.1.2

Fixes reference to nonexistent template. Manifest issue.

0.1.1

Renamed to django-envi.

0.1

Initial version.

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-envi-0.2.tar.gz (4.4 kB view details)

Uploaded Source

File details

Details for the file django-envi-0.2.tar.gz.

File metadata

  • Download URL: django-envi-0.2.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-envi-0.2.tar.gz
Algorithm Hash digest
SHA256 50d62de6739bd833b49a0c658c9dd5e03be6ca8c689dd9bd9d1a5494895c8390
MD5 ea3eec3105629afd8cdf08c4803db10b
BLAKE2b-256 d152c45d99a6293609e3a32bb6d07e9c34f24aa604e24a4fa4f25c16597f5844

See more details on using hashes here.

Supported by

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