Authentication using email only
Project description
settings.py:
INSTALLED_APPS = [ ... 'django_auth_email', ... ]
And run command:
./manage.py makemigrations django_auth_email ./manage.py migrate
Will be create a table in the DB – django_auth_email_option. Model:
class Option(models.Model): user = models.ForeignKey(User) code = models.CharField(max_length=56) expiry = models.DateTimeField()
Sign-in/up:
>>> from django_auth_email.models import DEAMng >>> auth = DEAMng() >>> code = auth.set_code(form.instance.email) >>> print(code) c0fca3619e2a0692a0f7bc79388cc51b5c805b22f5718e342bafd986
Authorization:
>>> check = DEAMng() >>> if check.is_valid(code): >>> auth.login(request, check.get_user()) >>> check.clean_dea()
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
Close
Hashes for django-auth-email-0.0.1a4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3a7dd9d8a1a3144938e4c696851240d4898abc98c49dee13249763c4c2178f8 |
|
MD5 | 9153468ac0fbfd70be5bf52551ffd2a2 |
|
BLAKE2b-256 | fa42805217f18febb424bbc098fc0c74a4835ac2a1de56f7f65407139ada6706 |