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.9.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bb3b38cde78606f0e140dbdbd025a9832390423bed82f7d9e4ba20ecc985fab |
|
MD5 | 8aa6f806a7d20e19dace497bc89e814f |
|
BLAKE2b-256 | ea0da817be39bd484f16b4d594c6a5c4e670d110d95d09963e855d7920f4a818 |
Close
Hashes for django_user_email_extension-1.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d794d5ec91919fedc4b2c468b10cc69aa1db014227bc0397859fa48b01ac5d93 |
|
MD5 | 452a4bb169b1d99030e9dc7507be6289 |
|
BLAKE2b-256 | 2b0f78b024aeb4cb40e9fef013f11c4b057c7181bc4a3793c95061b07d4f64b8 |