No project description provided
Project description
Django Login Email
Allow user to login with only email.
Install
pip install django-login-email
List of the urls for exmaple project:
/homefor protected url./account/loginfor login./account/logoutfor logout./account/verifyfor email verify.
Feature
- The developer could define their own
Usermodel. - Time-limited of login link.
- limited of sending email. Using TimeLimt to set minutes.
- The link could be used for Login once.
- Ban the IP to send mail frequently without login.
- Multiple user.
- More easier and customizable login link.
Usage
- add
django_login_emailto your appsettings.py.
INSTALLED_APP = [
...,
'django_login_email',
...
]
- Implement the LoginView, for example, like this:
from django.shortcuts import render
from django_login_email import views as v
from django_login_email import email as e
# Create your views here.
class MyInfo(e.EmailLoginInfo):
def set_variables(self):
self.subject = "Login request from meterhub"
self.welcome_text = "Welcome to meterhub! Please click the link below to login.<br>"
self.from_email = "sandbox.smtp.mailtrap.io"
class LoginView(v.EmailLoginView):
email_info_class = MyInfo
class VerifyView(v.EmailVerifyView):
pass
- set the view in your
urls.py.
from django.contrib import admin
from django.urls import path
from <yourapp> import views as v
from django_login_email.views import HomeView
urlpatterns = [
...,
path("account/login", v.LoginView.as_view(), name="login"),
path("account/verify", v.VerifyView.as_view(), name="verify"),
path("account/logout", v.LogoutView.as_view(), name="logout"),
path("", HomeView.as_view(), name="home"),
]
That's all.
Future
- Academically prove the safety of this method.
Related project
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_login_email-0.4.1.tar.gz.
File metadata
- Download URL: django_login_email-0.4.1.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d21bc6f85bc582d344d7824a50c3cd6f069c7a163b69a5b1095fe9378cc2425
|
|
| MD5 |
1e8ba0a9733717a70fa60787fb6ab31f
|
|
| BLAKE2b-256 |
e6bdf3fae15a2247ac470d342c2162bd6729b0b1fb5e9bdbfbbe6e83c6a1b49f
|
File details
Details for the file django_login_email-0.4.1-py3-none-any.whl.
File metadata
- Download URL: django_login_email-0.4.1-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1f9c634c46d497be1b0577004fb0990a480995c46fec6fa5f55f507803330b2
|
|
| MD5 |
db48510d3262db33e1788d9457ed8e80
|
|
| BLAKE2b-256 |
ae82001b4ff943ef64d842e080bd952025e46bf73bd9e0e2e964f7916f9b24fc
|