skip to navigation
skip to content

django-templarbit 1.0.5

Templarbit protects Django applications from XSS attacks and other malicious activity.

Requirements

  • Python 2.7 or 3.4+
  • A supported version of Django (currently 1.8+)
  • Your Templarbit Property ID and API Key

Installation

To install django-templarbit simply run:

$ pip install django-templarbit

Example App

An example app with templarbit installed can be found here: https://github.com/templarbit/django-example

Configuration

We need to hook django-templarbit into our project. Put templarbit into your INSTALLED_APPS at settings module:

INSTALLED_APPS = (
 '...',
 'templarbit',
)

Add templarbit middleware to your settings.py.

MIDDLEWARE = (
    'templarbit.middleware.TemplarbitMiddleware',
    '...',
)

Add the Templarbit configuration environment variables to your project:

$ export TEMPLARBIT_PROPERTY_ID='property_id'
$ export TEMPLARBIT_API_TOKEN='api_token'

That’s all!

To check your installation, you can examine the response headers from your application by running a simple curl -v http://127.0.0.1:8000/. Notice the Content-Security-Policy header pulled from Templarbit.

 
File Type Py Version Uploaded on Size
django-templarbit-1.0.5.tar.gz (md5) Source 2017-09-05 19KB