Skip to main content
Django Header Auth
==================

An extremely simple Django middleware for authorizing requests based on headers.

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

1. Install via pip:

:::bash
$ pip install django-header-auth

2. Add the `HeaderAuthMiddleware`:

:::python
MIDDLEWARE_CLASSES = (
# ...
'header_auth.middleware.HeaderAuthMiddleware',
# ...
)

Usage
-----

Add a `HEADER_AUTH` dict containing the headers you'd like to check to the settings file:

:::python
HEADER_AUTH = {
'HTTP_X_SOME_HEADER': 'sometoken',
'HTTP_X_ANOTHER_HEADER': 'anothertoken',
}

The request's headers will be checked for 'X-Some-Header: sometoken' and 'X-Another-Header: anothertoken' and simply pass through if everything is ok. Otherwise a 403 Forbidden will be returned.

Copyright
---------

Copyright (c) 2013 [LocalMed, Inc.](http://www.localmed.com/). See LICENSE for details.

Release files for django-header-auth 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-header-auth 0.1.0
File Size Uploaded
django-header-auth-0.1.0.tar.gz 3.5 kB Details

Release files / django-header-auth-0.1.0.tar.gz

Download URL django-header-auth-0.1.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f703dc4c860c0743852838151b9143ce0a7bddec9be799062e56543b4a70b47e
BLAKE2b-256 checksum
How to use checksums
089aeaf407d0bb41407883cea28e9ce92dda936c7ac10dcaf9aa6c3fc79ad331
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page