User model extender for django
Project description
Django-User-Email-Extension
Django application that extends User module, and provides email verification process.
Install
pip install django-user-email-extension
Add to installed apps, and email provider details:
INSTALLED_APPS = [
# ...
'django_user_email_extension',
# ...
]
EMAIL_USE_TLS = True
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = os.environ.get('email_host')
EMAIL_PORT = os.environ.get('email_port')
EMAIL_HOST_USER = os.environ.get('email_username')
EMAIL_HOST_PASSWORD = os.environ.get('email_password')
Run migrations:
python3 manage.py makemigrations
python3 manage.py migrate
Optional:
add to settings.py, if not set, verification email will never expire.
# ...
DJANGO_EMAIL_VERIFIER_EXPIRE_TIME = 24 # In Hours
# ...
Usage Example
use:
from django_user_email_extension.models import *
user_object = User.objects.create_user('EMAIL', 'PASSWORD')
# user is a Django User object
user_object.create_verification_email()
# Send the verification email
user_object.send_verification_email(subject=subject,
body=body,
from_mail=EMAIL_HOST_USER)
# Initiate verification process
verify_record(uuid_value=uuid)
The confirmation uuid can be sent as part of the body for example:
body = 'Follow this link to verify your account: https://nalkins.cloud' + \
'%s' % reverse('verify_account',
kwargs={'uuid': str(user_object.get_uuid_of_email())})
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
Close
Hashes for django-user-email-extension-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecda57dc007de7f4e7318b6733071ad3900d600177c9cabc65124c990f192132 |
|
MD5 | 33731e5b362ae82b6d5bbadba3fc0a76 |
|
BLAKE2b-256 | 8feedb5c97f6134237d41d66ace0a0ce69e4781d3e6732679f980e66dc6b98f4 |
Close
Hashes for django_user_email_extension-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f38460a34d486073b377cfc23c2d88257cb9100ac92aa6025cd50837d8470cea |
|
MD5 | 0f45b33a915bd15d8b09cc473dd555a4 |
|
BLAKE2b-256 | 61939707ec0988d1e7ec8791885f5a5a14b4739bd6e9628d596c95462dbaa814 |