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.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87725592749156e1026abebc4922dfdb8aba0698ef3e443f6d3557fb50afb393 |
|
MD5 | 1d0aece24d5e0dfc9d7716a6dd081902 |
|
BLAKE2b-256 | c9005d8c46f469f2dbf5a73aee00e598fa908a15435ae0495ba656c98c790558 |
Close
Hashes for django_user_email_extension-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9901cb1e212b557e14d0eb47da7f9d87c9cb3ccaccd19824506a750e94c08f2d |
|
MD5 | 272f229c4dad13bb8eca5c19db5447ff |
|
BLAKE2b-256 | bb1bd2c78c1729ad05d670785c68a3494dc9bd642a48fe1926b1ec4fcfe415f3 |