Skip to main content

Visually distinguish environments in Django Admin

Project description

============================= django-admin-env-notice

.. image:: :target:

.. image:: :target:

.. image:: :target:

.. image::!-1EAEDB.svg :target:

Visually distinguish environments in Django Admin. Based on great advice from post: 5 ways to make Django Admin safer <>_ by hakibenita <>_.


  • Python 2.7, 3.4+
  • Django 1.9+


Install django-admin-env-notice::

pip install django-admin-env-notice

Add it to your INSTALLED_APPS before django.contrib.admin:

.. code-block:: python


Add context processor:

.. code-block:: python

        "OPTIONS": {
            "context_processors": [

Set label and color for current environment:

.. code-block:: python

ENVIRONMENT_NAME = "Production server"

Override django admin selector if necessary (default: body), e.g: grappelli:

.. code-block:: python


Optionally, se the environment banner to float over instead of being fixed to the top:

.. code-block:: python



.. image:: ./screenshots/prod.png .. image:: ./screenshots/dev.png .. image:: ./screenshots/testing.png

Running Tests

Does the code actually work?


source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox


Tools used in rendering this package:

  • Cookiecutter_
  • cookiecutter-djangopackage_

.. _Cookiecutter: .. _cookiecutter-djangopackage:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-admin-env-notice, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size django_admin_env_notice-0.2-py2.py3-none-any.whl (5.5 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size django-admin-env-notice-0.2.tar.gz (4.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page