Project Description
email_verification is a django package that verifies a user's email on registration.
- An email is sent to registered users to verify their email before login.
- All users that are not verified after 24hrs will be automatically deleted from the database.
Installation
pip install django-email-certify
Setup
After a successful installation, you will need to setup your django project to use the package. Follow the steps below to do that.
First, we need to add email_verification to our project's INSTALLED_APPS
# settings.py
INSTALLED_APPS = [
# ...other apps
"email_verification.apps.EmailVerificationConfig",
]
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = "smtp.gmail.com"
EMAIL_PORT = 465
EMAIL_HOST_USER = "your_email_user"
EMAIL_HOST_PASSWORD = "your_email_password"
EMAIL_USE_SSL = True
DEFAULT_FROM_EMAIL = "Default<no_reply@domain.com>"
LOGIN_URL = "" # ensure to set this
Next, we will add the url configuration for our package.
# urls.py
urlpatterns = [
# ...other urls
path("verify-email/", include("email_verification.urls")),
]
python manage.py migrate
Next, we'll need to handle inactive user deletion for our project. To do that, we will be adding some configuration to our wsgi.py file
# wsgi.py
from threading import Thread
application = get_wsgi_application() # already in code
# this should come after the get_wsgi_application() object
from email_verification.views import delete_inactive_users
t = Thread(target=delete_inactive_users)
t.start()
That's all for the configurations. Next up, we will be using verifying our users using a django form
# views.py
from email_verification.views import VerifyEmail
def signup(request):
form = RegisterForm() # create your form class
if request.method == "POST":
form = RegisterForm(request.POST)
if form.is_valid():
VerifyEmail(request, form)
return redirect("redirect_url")
return render(request, "register.html", {"form": form})
Metadata
Release files for django-email-certify 1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-email-certify-1.1.tar.gz | 6.8 kB | Without provenance | Details for django-email-certify-1.1.tar.gz |
Release files / django-email-certify-1.1.tar.gz
| Download URL | django-email-certify-1.1.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
432424e41ccb359921ad7d4d80bb7b04181e9cbafa05bab9aa578403f1defebf
|
|
BLAKE2b-256 checksum How to use checksums |
99e604230c97644ee601b3e0e46c0d3982c637ac9cec48529260f4c23228086c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Security for django-email-certify 1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.