Giter Site home page Giter Site logo

terranodo / django-classification-banner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from garnertb/django-classification-banner

0.0 4.0 0.0 214 KB

A django app that adds classification banners to your site.

License: MIT License

Python 75.66% CSS 7.93% HTML 16.41%

django-classification-banner's Introduction

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 %}
<html>
	<head>
		<title>FOO</title>
	</head>
	<body>
		{% classification_banner %}
	</body>
</html>

You can also override your default settings from any template:

{% load classification_banner %}
<html>
	<head>
		<title>FOO - Confidential</title>
	</head>
	<body>
		{% classification_banner classification_text='Confidential' classification_text_color='black' classification_background_color='red'%}
	</body>
</html>

django-classification-banner's People

Contributors

garnertb avatar pjdufour avatar

Watchers

Ariel Núñez avatar Jeffrey Johnson avatar James Cloos avatar Jen Duncan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.