Django app for user authentication
Project description
DjaoDjin-Signup
This repository contains a Django App for frictionless signup.
The app will register and login a user with as little as only an email address.
When the user logs out and tries to logs back in with the same email address, the app will first verify the email address through an activation url send to the registered email address. Setting the password is deferred to after the email address has been verified.
If during the first login and/or subsequent login, the email address should be verified before moving forward (ex: before presenting a payment view), you should decorate the view with an active_required decorator.
This project contains bare bone templates which are compatible with Django and Jinja2 template engines. To see djaodjin-signup in action as part of a full-fledged subscription-based session proxy, take a look at djaoapp.
Install
Add the signup urls to your urlpatterns and EmailOrUsernameModelBackend to the settings AUTHENTICATION_BACKENDS.
urls.py:
urlpatterns = ('',
(r'^api/', include('signup.urls.api')),
(r'^', include('signup.urls.views')),
)
settings.py:
AUTHENTICATION_BACKENDS = (
'signup.backends.auth.EmailOrUsernameModelBackend',
'django.contrib.auth.backends.ModelBackend'
)
Development
After cloning the repository, create a virtualenv environment, install the prerequisites, create and load initial data into the database, then run the testsite webapp.
$ python -m venv .venv
$ source .venv/bin/activate
$ pip install -r testsite/requirements.txt
$ make vendor-assets-prerequisites
$ make initdb
$ python manage.py runserver
# Browse http://localhost:8000/
Release Notes
Tested with
- Python: 3.7, Django: 3.2 (LTS)
- Python: 3.10, Django: 4.2 (latest) - see #55
- Python: 2.7, Django: 1.11 (legacy) - use testsite/requirements-legacy.txt
0.9.7
- fixes API to activate a user when an e-mail code is generated
- fixes deleting API keys when a User is deleted
- fixes database rollback when creating a User and phone number already exists
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for djaodjin_signup-0.9.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19b8e6dad7d37d5c029d997b3f67b11092fd8f713d8bbbd17873f07c81f45b9f |
|
MD5 | 0ac4a28badaecb30e5bf84b7b02fffad |
|
BLAKE2b-256 | 48352c2df361cde8e193ff42227af876819ee2a93ce2e2f1ffcb10f47945af0c |