Skip to main content

django-pin-passcode Circle CI

Django Pin Passcode Example

This is a simple app that adds a site wide pin-passcode for quick authentication. I wrote this originally for my personal motivation tracker chin up so I could quickly login from my phone.

You enter a PIN passcode (using 0-9 and #, can use numpad) until the correct pin is entered, then:

  • If PIN_PASSCODE_USERNAME is set, you will be logged in as this user

  • Otherwise, a session variable will be set and you will be able to browse the site

Installation

pip install django-pin-passcode
# settings.py

INSTALLED_APPS += (
    'pin_passcode',
)

...

MIDDLEWARE_CLASSES += (
    'pin_passcode.middleware.PinPasscodeMiddleware',
)

...

# user to sign in as, omit this option to use a session variable instead
# PIN_PASSCODE_USERNAME = 'eric' # uncomment this to login as "eric" after valid pin code is entered

# the passcode required to login as the above user, using 0-9 and '#'
# If no PIN is set, pin passcode will allow anyone to access the site 
PIN_PASSCODE_PIN = 1234

# IP addresses to give access to automatically
PIN_PASSCODE_IP_WHITELIST = ('123.123.123.123',)
# urls.py

urlpatterns = patterns(
    ...
    url(r'^', include('pin_passcode.urls')),
    ...
)

Testing

pip install -r requirements.txt

py.test

Release notes

0.3.1

  • Empty PIN_PASSCODE_PIN disables pin passcode

0.3.0

  • Switched to Python 3 and added support for Django >= 2.1

0.2.0

  • Added MiddlewareMixin for > Django 1.10 compatibility

Download files

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

Source Distribution

django-pin-passcode-0.3.1.tar.gz (41.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_pin_passcode-0.3.1-py3-none-any.whl (42.2 kB view details)

Uploaded Python 3

File details

Details for the file django-pin-passcode-0.3.1.tar.gz.

File metadata

  • Download URL: django-pin-passcode-0.3.1.tar.gz
  • Upload date:
  • Size: 41.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.4

File hashes

Hashes for django-pin-passcode-0.3.1.tar.gz
Algorithm Hash digest
SHA256 e863baa82b8eace89807ba9021b9da49482a322ea2eec7be44f109cd8e72645d
MD5 446e70a9df13175acb3d604e9a5358a1
BLAKE2b-256 a07f20014fbc2a56b747e5c30f5e03e5948464438292d776584b747bb80d6f72

See more details on using hashes here.

File details

Details for the file django_pin_passcode-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: django_pin_passcode-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 42.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.4

File hashes

Hashes for django_pin_passcode-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 38eeaa4b469314a3980b54bfca5c30662ce24f9dcd8adb2b9a156fdcdd8019fe
MD5 1b3a0142a6c6411510b654d60f983667
BLAKE2b-256 72983541f25c8d6c70e8f1860e0885b80ee0de81f86ed032a6f6dae3020cd5a3

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 files

0.3.0

1 file

0.2.0

1 file

0.1.9

1 file

0.1.8

1 file

0.1.7

1 file

0.1.6

1 file

0.1.5

1 file

0.1.4

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

0.1.0

1 file

0.0.9

1 file

0.0.8

1 file

0.0.7

1 file

0.0.6

1 file

0.0.5

1 file

0.0.4

1 file

0.0.3

1 file

0.0.2

1 file

0.0.1

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page