Skip to main content

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:

  • /home for protected url.
  • /account/login for login.
  • /account/logout for logout.
  • /account/verify for email verify.

Feature

  • The developer could define their own User model.
  • 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_email to your app settings.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_login_email-0.4.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_login_email-0.4.1-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

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

Hashes for django_login_email-0.4.1.tar.gz
Algorithm Hash digest
SHA256 3d21bc6f85bc582d344d7824a50c3cd6f069c7a163b69a5b1095fe9378cc2425
MD5 1e8ba0a9733717a70fa60787fb6ab31f
BLAKE2b-256 e6bdf3fae15a2247ac470d342c2162bd6729b0b1fb5e9bdbfbbe6e83c6a1b49f

See more details on using hashes here.

File details

Details for the file django_login_email-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_login_email-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a1f9c634c46d497be1b0577004fb0990a480995c46fec6fa5f55f507803330b2
MD5 db48510d3262db33e1788d9457ed8e80
BLAKE2b-256 ae82001b4ff943ef64d842e080bd952025e46bf73bd9e0e2e964f7916f9b24fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page