Skip to content

The unseen, silent tribute to those we have lost.

License

Notifications You must be signed in to change notification settings

ractf/django-clacks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Clacks

The unseen, silent tribute to those we have lost.

python-versions version discord


django-clacks contains boilerplate code for working with the nonstandard HTTP header X-Clacks-Overhead.

You can find out more about the X-Clacks-Overhead header here: https://xclacksoverhead.org/home/about

Installation

Django Clacks is on PyPI. Install it with pip install django-clacks or add it with your dependency manager.

Quickstart

Add clacks.middleware.ClacksMiddleware to your MIDDLEWARE setting:

MIDDLEWARE = [
    # ...
    "clacks.middleware.ClacksMiddleware",
    # ...
]

By default, all responses will now have a header X-Clacks-Overhead, with the content GNU Terry Pratchett.
You can modify the names used with the CLACKS_NAMES setting. The following setting:

CLACKS_NAMES = [
    "Terry Pratchett",
    "Joe Armstrong",
]

Will result in an X-Clacks-Overhead header containing GNU Terry Pratchett, Joe Armstrong.