Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/garnertb/django-classification-banner

A django app that adds classification banners to your site.
https://github.com/garnertb/django-classification-banner

Last synced: 2 months ago
JSON representation

A django app that adds classification banners to your site.

Awesome Lists containing this project

README

        

django-classification-banner
============================

A django app that adds classification banners to your site.

Installation
------------

The easiest way to install django-classification-banner is directly from PyPi using pip by running the command below:

```pip install django-classification-banner```

Otherwise you can download django-classification-banner and install it directly from source:

```python setup.py install```

Project Configuration
---------------------

Once installed you can configure your project to use the
django-classification-banner with the following steps.

Add ``django_classification_banner`` to ``INSTALLED_APPS`` in your project's
``settings`` module:

INSTALLED_APPS = (
# other apps
'django_classification_banner',
)

Add the classification banner context processor to the ```TEMPLATE_CONTEXT_PROCESSORS``` setting in your project's
``settings`` module:

TEMPLATE_CONTEXT_PROCESSORS = (
# other context processors
'django_classification_banner.context_processors.classification',
)

Customize your site's classification settings in the ``settings`` module:

CLASSIFICATION_TEXT = 'Unclassified//FOUO'
CLASSIFICATION_TEXT_COLOR = 'black'
CLASSIFICATION_BACKGROUND_COLOR = 'green'
CLASSIFICATION_LINK = '/security'

Usage
-----

Once installed, you can easily add a classification banner to any template on your site.

First load the classification banner in your template:

{% load classification_banner %}

Then add the banner to your page:

{% classification_banner %}

A full example:

{% load classification_banner %}


FOO


{% classification_banner %}

You can also override your default settings from any template:

{% load classification_banner %}


FOO - Confidential


{% classification_banner classification_text='Confidential' classification_text_color='black' classification_background_color='red'%}