Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.
/ django-nopassword Public archive

Authentication backend for django that uses a one time code instead of passwords

License

Notifications You must be signed in to change notification settings

relekang/django-nopassword

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-nopassword

Build Status PyPi version
Disclaimer: I am writing this to learn more about custom authentication in django. Inspired by Is it time for password-less login? by Ben Brown

Installation

Run this command to install django-nopassword

pip install django-nopassword

Requirements

Django >= 1.4 (1.5 custom user is supported)

Usage

Add the app to installed apps

INSTALLED_APPS = (
    ...
    'django_nopassword',
    ...
)

Set the authentication backend to EmailBackend

AUTHENTICATION_BACKENDS = ( 'django_nopassword.backends.EmailBackend', )

Add urls to your urls.py

urlpatterns = patterns('',
    ...
    url(r'^accounts/', include('django_nopassword.urls')),
    ...
)

Settings

NOPASSWORD_LOGIN_CODE_TIMEOUT

default: 900 (15 minutes)
Defines how long a login code is valid in seconds.

NOPASSWORD_AUTOCOMPLETE

default: False Activates autocomplete in login form. Be aware of the potensial security risk and privacy risk by publicly viewing all usernames and full names. Only do this if you are certain your users would not mind.

NOPASSWORD_HIDE_USERNAME

default: False If set to True, the login url will not contain

NOPASSWORD_LOGIN_EMAIL_SUBJECT

default: Login code

Sets Email Subject for Login Emails

Django settings used by django-nopassword

SERVER_URL

default: example.com

DEFAULT_FROM_EMAIL

default: root@example.com