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-1.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7457a1a7abfb039eecbec47e898c647c083821734f520d5aa7f2cd0003d9e7b4 |
|
MD5 | efb421458f2d0742d9cc39bcfcc4207f |
|
BLAKE2b-256 | e901a74ec61c12a735b146fef2af2ef1130d6e1e87681089708a573910d46e62 |
Close
Hashes for django_user_email_extension-1.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4304705e092d0d17d51b88470cb26e7310a1bc3178948f61b456f124c0c8365b |
|
MD5 | 6a12bf6d69678ad2ed63ebc334f90aa0 |
|
BLAKE2b-256 | 7a0e4e7ba2061b97cf2fd1d55478e41a2c88cf9708a29f1939a0c98419436a41 |