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.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a2fa15e74aec1d6bdf7abf5b9a071331d3d92ec922b1d24f746f8653cf17505 |
|
MD5 | 9165451ff9b5a32773335cda7653da6a |
|
BLAKE2b-256 | f5cde2c2d414a126cf8c0f0b22b16bc192f4eb4e2a2410f7bbdecac923c73327 |
Close
Hashes for django_user_email_extension-0.1.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8deb26d0bac230ae35916e2a0d0bf9d7bdf644be5a1b008806653958c8d89d39 |
|
MD5 | c0f4665d90db795f6cd7178bd263d332 |
|
BLAKE2b-256 | bbe2ca46d8b646ed527e11b9ca70013cd50d44edbaa9372570e436f1c9fee608 |