Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/garnertb/django-classification-banner
- Owner: garnertb
- License: mit
- Created: 2013-06-24T01:09:17.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2020-03-05T14:17:45.000Z (almost 5 years ago)
- Last Synced: 2024-10-05T09:02:00.520Z (3 months ago)
- Language: Python
- Size: 209 KB
- Stars: 4
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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'%}