Skip to main content

Visually distinguish environments in Django Admin

Project description


.. image::

.. image::

.. image::

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

"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



.. 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.1.4
Filename, size File type Python version Upload date Hashes
Filename, size django_admin_env_notice-0.1.4-py2.py3-none-any.whl (6.0 kB) File type Wheel Python version 3.5 Upload date Hashes View
Filename, size django-admin-env-notice-0.1.4.tar.gz (4.4 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