Skip to main content

Basic auth utilities for Django.

Project description

Basic auth utilities for Django.

Requires

Tested under…

  • Python

    • 2.7

    • 3.6

  • Django

    • 1.8

    • 1.10

    • 1.11

Installation

pip install django-basicauth

Usage

from basicauth.decorators import basic_auth_required

@basic_auth_required
def myview(request):
    ...

or by a middleware.

MIDDLEWARE_CLASSES = (
    'basicauth.middleware.BasicAuthMiddleware',
    ...
)

Settings

  • BASICAUTH_USERS (required): Dictionary including keys as username and values as passwords.

  • BASICAUTH_REALM: realm string, default is “Secure resource”.

  • BASICAUTH_DISABLE: Disable all of barriers by this library.

Changes

0.4 (2017-09-30)

  • Supported Python 2.7

  • Dropped Django1.9

  • Supported Django 1.10+ style middleware

0.3 (2017-08-28)

  • Added BASICAUTH_DISABLE setting

  • Changed API of basicauthutils.validate_request
    • Fixed to return True/False

    • Adding REMOTE_USER by this function

0.2.1 (2017-08-28)

  • Officially supported Django 1.11, 1.10, 1.9

0.2 (2016-03-31)

0.1 (2015-04-20)

  • Initial

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-basicauth-0.4.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

django_basicauth-0.4-py3-none-any.whl (5.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page