Visually distinguish environments in Django Admin
Project description
=============================
django-admin-env-notice
=============================
.. image:: https://badge.fury.io/py/django-admin-env-notice.svg
:target: https://badge.fury.io/py/django-admin-env-notice
.. image:: https://travis-ci.org/dizballanze/django-admin-env-notice.svg?branch=master
:target: https://travis-ci.org/dizballanze/django-admin-env-notice
.. image:: https://codecov.io/gh/dizballanze/django-admin-env-notice/branch/master/graph/badge.svg
:target: https://codecov.io/gh/dizballanze/django-admin-env-notice
Visually distinguish environments in Django Admin. Based on great advice from post: `5 ways to make Django Admin safer <https://hackernoon.com/5-ways-to-make-django-admin-safer-eb7753698ac8>`_ by `hakibenita <https://hackernoon.com/@hakibenita>`_.
Requirements
-----------
- Python 2.7, 3.4+
- Django 1.9+
Quickstart
----------
Install django-admin-env-notice::
pip install django-admin-env-notice
Add it to your `INSTALLED_APPS` before `django.contrib.admin`:
.. code-block:: python
INSTALLED_APPS = (
...
'django_admin_env_notice',
'django.contrib.admin',
...
)
Add context processor:
.. code-block:: python
TEMPLATES = [
{
...
"OPTIONS": {
"context_processors": [
...
"django_admin_env_notice.context_processors.from_settings",
],
},
},
]
Set label and color for current environment:
.. code-block:: python
ENVIRONMENT_NAME = "Production server"
ENVIRONMENT_COLOR = "#FF2222"
Override django admin selector if necessary (default: body), e.g: grappelli:
.. code-block:: python
ENVIRONMENT_ADMIN_SELECTOR = "grp-header"
Screenshots
-----------
.. 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
Credits
-------
Tools used in rendering this package:
* Cookiecutter_
* `cookiecutter-djangopackage`_
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage
django-admin-env-notice
=============================
.. image:: https://badge.fury.io/py/django-admin-env-notice.svg
:target: https://badge.fury.io/py/django-admin-env-notice
.. image:: https://travis-ci.org/dizballanze/django-admin-env-notice.svg?branch=master
:target: https://travis-ci.org/dizballanze/django-admin-env-notice
.. image:: https://codecov.io/gh/dizballanze/django-admin-env-notice/branch/master/graph/badge.svg
:target: https://codecov.io/gh/dizballanze/django-admin-env-notice
Visually distinguish environments in Django Admin. Based on great advice from post: `5 ways to make Django Admin safer <https://hackernoon.com/5-ways-to-make-django-admin-safer-eb7753698ac8>`_ by `hakibenita <https://hackernoon.com/@hakibenita>`_.
Requirements
-----------
- Python 2.7, 3.4+
- Django 1.9+
Quickstart
----------
Install django-admin-env-notice::
pip install django-admin-env-notice
Add it to your `INSTALLED_APPS` before `django.contrib.admin`:
.. code-block:: python
INSTALLED_APPS = (
...
'django_admin_env_notice',
'django.contrib.admin',
...
)
Add context processor:
.. code-block:: python
TEMPLATES = [
{
...
"OPTIONS": {
"context_processors": [
...
"django_admin_env_notice.context_processors.from_settings",
],
},
},
]
Set label and color for current environment:
.. code-block:: python
ENVIRONMENT_NAME = "Production server"
ENVIRONMENT_COLOR = "#FF2222"
Override django admin selector if necessary (default: body), e.g: grappelli:
.. code-block:: python
ENVIRONMENT_ADMIN_SELECTOR = "grp-header"
Screenshots
-----------
.. 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
Credits
-------
Tools used in rendering this package:
* Cookiecutter_
* `cookiecutter-djangopackage`_
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django-admin-env-notice-0.1.2.tar.gz
.
File metadata
- Download URL: django-admin-env-notice-0.1.2.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e71078b498821f260d4fbf89bd752faa76747a57e8bdf8808defbd987dab0502 |
|
MD5 | c540a81c48fe53e04282f66cf14b2bbc |
|
BLAKE2b-256 | e4dae2f8ecbfccfcadce17d62713c323e7e83df9171ccd34cbaf315b03c2a8bd |
File details
Details for the file django_admin_env_notice-0.1.2-py2.py3-none-any.whl
.
File metadata
- Download URL: django_admin_env_notice-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 431dc81df8c181521321dd7b225cc9614bc3c6bcda1ebac50a17ae003931d7c0 |
|
MD5 | 6c7ee7bdde73d9cd62006a06e506ac85 |
|
BLAKE2b-256 | 2334b6b6b5ab26fab0b19f71c6c86a6f885c90ca3eb5669efdd4a70777872713 |