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.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.1

  • adds multiple API keys per user
  • sends verification codes as an alternative to URL links
  • supports OpenAPI 3 schema for API documentation
  • prevents a HEAD HTTP request to expire one-time reset links

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.1.tar.gz (98.4 kB view details)

Uploaded Source

Built Distribution

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

djaodjin_signup-0.9.1-py3-none-any.whl (161.2 kB view details)

Uploaded Python 3

File details

Details for the file djaodjin-signup-0.9.1.tar.gz.

File metadata

  • Download URL: djaodjin-signup-0.9.1.tar.gz
  • Upload date:
  • Size: 98.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.12

File hashes

Hashes for djaodjin-signup-0.9.1.tar.gz
Algorithm Hash digest
SHA256 a0a36b1b8263a47125153fa35be7f97b66a06bb10c66b5376c2b30f4e82f2cbd
MD5 599fb11303be8b3acdb9a69f2b49e98d
BLAKE2b-256 33f6223da5624a753623be3ca1b3c65a4d133dcf69959f080a857fee54c8b705

See more details on using hashes here.

File details

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

File metadata

  • Download URL: djaodjin_signup-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 161.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.12

File hashes

Hashes for djaodjin_signup-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 89228c690fd34927be68dc006524de7580cb6646eb2aaa7eda8e47e4d8e50531
MD5 c9293bfd04c5aa4f4b326221efa425ce
BLAKE2b-256 c587f1762e57bbbb62a78795b076dd676f43f61f5a8e31c164f323c51ee7cee1

See more details on using hashes here.

Supported by

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