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'
)
To make the application useable accross a variety of websites, signup never
sends any e-mails directly. It relies on triggering signals whenever
a notification must be generated. As a result, to verify a user email address
and activate her account, you will need to implement a listener for the
user_verification signal and send the e-mail from there.
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.0
- introduces phone verification backend
- compatibles with Bootstrap5
- silences bots POSTing to
regsiter/. - fixes
phonenumber.to_pythonmay returnNone - fixes forgot password when a
Useris deleted but notContact
Release files for djaodjin-signup 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| djaodjin-signup-0.9.0.tar.gz | 92.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| djaodjin_signup-0.9.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 243.9 kB
Release files / djaodjin-signup-0.9.0.tar.gz
| Download URL | djaodjin-signup-0.9.0.tar.gz |
|---|---|
| Size | 92.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6bb9496231e9ccc8be9283f882bffb459c756459a3d51d3a67a33015c0d23563
|
|
BLAKE2b-256 checksum How to use checksums |
5602a914f18e0c1e6ab4bfa18dfc92d4a19b77391bf52cae4a8d83b60627ecd0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.12
|
Release files / djaodjin_signup-0.9.0-py3-none-any.whl
| Download URL | djaodjin_signup-0.9.0-py3-none-any.whl |
|---|---|
| Size | 151.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8738db6f78e6c161b7f46c6cf05d2c18bd1c0168a70b880dfe88bb61a7b5622f
|
|
BLAKE2b-256 checksum How to use checksums |
b03a5d187114f690c3c822c319b97e85d8393c684cdfaf1ec27b3b7bb23f57a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.12
|