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.

Source Distribution

django-admin-env-notice-0.2.tar.gz (4.6 kB view hashes)

Uploaded source

Built Distribution

Supported by

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