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.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebbd0e5c386772c62f4325c1bed73c83cf38add00bbf1051bb93f2cd29bdcaf8 |
|
MD5 | 07df503faab0c2bf8023bde692ce6864 |
|
BLAKE2b-256 | f4543468130da8f33b68c9ebb7b0ce5b242d4f797d6eb23f8b2c77066a01d25a |
Close
Hashes for django_user_email_extension-0.1.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a39d054bc0d4a96ca9a1a9598e88996f59b084f354d3bf12a5a5afa540a8e838 |
|
MD5 | 2e7aa3a7cf89c48f713c547180327c57 |
|
BLAKE2b-256 | 513dc3c56050aa29b067dcdbea4969b3c58cbd2beaa90c3f6680edd747ad1ada |