Skip to main content

Django app for user authentication

Project description

DjaoDjin-Signup

PyPI version

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.10, Django: 4.2 (LTS)
  • Python: 3.12, Django: 5.1 (next)
  • Python: 3.7, Django: 3.2 (legacy)

0.9.11

  • fixes exception edge cases when DEFAULT_FROM_EMAIL is empty or None
  • adds request context to user_registered signal

previous release notes

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

djaodjin_signup-0.9.11.tar.gz (100.7 kB view details)

Uploaded Source

Built Distribution

djaodjin_signup-0.9.11-py3-none-any.whl (163.8 kB view details)

Uploaded Python 3

File details

Details for the file djaodjin_signup-0.9.11.tar.gz.

File metadata

  • Download URL: djaodjin_signup-0.9.11.tar.gz
  • Upload date:
  • Size: 100.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for djaodjin_signup-0.9.11.tar.gz
Algorithm Hash digest
SHA256 7e142e38bf8418a9a654c8b076d2dd52e3dd7ea792f1d025c5890f95a890ef90
MD5 8d8c24ed4a712ceb83445a989664cf11
BLAKE2b-256 b5d2c97fcb54b9dae85f572aaeb9f176bcd38fed19a4bc627a17a6c2ce2d286e

See more details on using hashes here.

File details

Details for the file djaodjin_signup-0.9.11-py3-none-any.whl.

File metadata

File hashes

Hashes for djaodjin_signup-0.9.11-py3-none-any.whl
Algorithm Hash digest
SHA256 0875cfd9c03c7cdf866bb7ccb9743aa623fb06db58a0ba154c18ebb3e1857634
MD5 494c4b5f255bb78ee7ed67fc0b448708
BLAKE2b-256 dc2d68f1aaec6a4b7c1a0225790634e1436aa79fbc4d13aeed2d5fdf05ec5dc6

See more details on using hashes here.

Supported by

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