Name | django-login-email JSON |
Version |
0.6.2
JSON |
| download |
home_page | None |
Summary | A django app for login with email. |
upload_time | 2025-08-15 10:24:26 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.10 |
license | None |
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Django Login Email
[](https://pypi.python.org/pypi/django-login-email/)
[](https://django-login-email.readthedocs.io/en/latest/?badge=latest) [](https://pepy.tech/project/django-login-email)
Allow user to login and register with email address.
NOTICE: We are currently in the development stage. If you use this library, please upgrade to the latest version. Issues are welcome.
You can view the documentation [here](https://deepwiki.com/Svtter/django-login-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
- [x] The developer could define their own `User` model.
- [x] Time-limited of login link.
- [x] limited of sending email. Using TimeLimt to set minutes.
- [x] The link could be used for Login once.
- [x] Register new user.
- [x] Support multiple user.
- [x] Ban the IP to send mail frequently without login.
- [ ] Support [django-templated-email](https://github.com/vintasoftware/django-templated-email)
- [ ] Support Django Anymail
- [ ] Allow users to change their email address.
- [ ] Enable 2FA.
- [ ] More easier and customizable login link.
## Usage
- add `django_login_email` to your app `settings.py`.
```python
INSTALLED_APP = [
...,
'django_login_email',
...
]
```
- Implement the LoginView, for example, like this:
```python
from django.shortcuts import render
from django.urls import reverse
from django_login_email import email as e
from django_login_email import views as v
# Create your views here.
loginInfo, registerInfo = e.get_info_class("meterhub")
class LoginView(v.EmailLoginView):
login_info_class = loginInfo
register_info_class = registerInfo
class VerifyView(v.EmailVerifyView):
def get_success_url(self):
return reverse("home")
class LogoutView(v.EmailLogoutView):
pass
```
- set the view in your `urls.py`.
```python
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.
Debug the email with `docker run -d --name mailhog -p 1025:1025 -p 8025:8025 mailhog/mailhog`
## Settings
1. Config `LoginView.tl` to disable login attempts check.
2. View [settings/settings.py](./settings/settings.py) to config the email server account. As same as django official settings.
3. Disable login check:
```python
class YouLoginView(LoginView):
def check_could_send(self, email) -> bool:
# FOR DEBUG
return True
```
## Future
- Academically prove the safety of this method.
## Related project
- [django-email-verification](https://github.com/LeoneBacciu/django-email-verification)
- [django-login-with-email](https://github.com/wsvincent/django-login-with-email)
- [django-unique-user-email](https://github.com/carltongibson/django-unique-user-email)
Raw data
{
"_id": null,
"home_page": null,
"name": "django-login-email",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "svtter <svtter@qq.com>",
"download_url": "https://files.pythonhosted.org/packages/8a/d2/089c1a2e97442108aed04fd82ebeaedb6ccf8bb78b485e66cfad172ca377/django_login_email-0.6.2.tar.gz",
"platform": null,
"description": "# Django Login Email\n\n[](https://pypi.python.org/pypi/django-login-email/)\n[](https://django-login-email.readthedocs.io/en/latest/?badge=latest) [](https://pepy.tech/project/django-login-email)\n\nAllow user to login and register with email address.\n\nNOTICE: We are currently in the development stage. If you use this library, please upgrade to the latest version. Issues are welcome.\n\nYou can view the documentation [here](https://deepwiki.com/Svtter/django-login-email).\n\n## Install\n\n`pip install django-login-email`\n\nList of the urls for exmaple project:\n\n- `/home` for protected url.\n- `/account/login` for login.\n- `/account/logout` for logout.\n- `/account/verify` for email verify.\n\n## Feature\n\n- [x] The developer could define their own `User` model.\n- [x] Time-limited of login link.\n- [x] limited of sending email. Using TimeLimt to set minutes.\n- [x] The link could be used for Login once.\n- [x] Register new user.\n- [x] Support multiple user.\n- [x] Ban the IP to send mail frequently without login.\n- [ ] Support [django-templated-email](https://github.com/vintasoftware/django-templated-email)\n- [ ] Support Django Anymail\n- [ ] Allow users to change their email address.\n- [ ] Enable 2FA.\n- [ ] More easier and customizable login link.\n\n## Usage\n\n- add `django_login_email` to your app `settings.py`.\n\n```python\nINSTALLED_APP = [\n ...,\n 'django_login_email',\n ...\n]\n```\n\n- Implement the LoginView, for example, like this:\n\n```python\nfrom django.shortcuts import render\nfrom django.urls import reverse\n\nfrom django_login_email import email as e\nfrom django_login_email import views as v\n\n# Create your views here.\n\nloginInfo, registerInfo = e.get_info_class(\"meterhub\")\n\n\nclass LoginView(v.EmailLoginView):\n login_info_class = loginInfo\n register_info_class = registerInfo\n\n\nclass VerifyView(v.EmailVerifyView):\n def get_success_url(self):\n return reverse(\"home\")\n\n\nclass LogoutView(v.EmailLogoutView):\n pass\n\n\n\n```\n\n- set the view in your `urls.py`.\n\n```python\nfrom django.contrib import admin\nfrom django.urls import path\nfrom <yourapp> import views as v\nfrom django_login_email.views import HomeView\n\nurlpatterns = [\n ...,\n path(\"account/login\", v.LoginView.as_view(), name=\"login\"),\n path(\"account/verify\", v.VerifyView.as_view(), name=\"verify\"),\n path(\"account/logout\", v.LogoutView.as_view(), name=\"logout\"),\n path(\"\", HomeView.as_view(), name=\"home\"),\n]\n```\n\nThat's all.\n\nDebug the email with `docker run -d --name mailhog -p 1025:1025 -p 8025:8025 mailhog/mailhog`\n\n## Settings\n\n1. Config `LoginView.tl` to disable login attempts check.\n2. View [settings/settings.py](./settings/settings.py) to config the email server account. As same as django official settings.\n3. Disable login check:\n\n```python\nclass YouLoginView(LoginView):\n def check_could_send(self, email) -> bool:\n # FOR DEBUG\n return True\n```\n\n## Future\n\n- Academically prove the safety of this method.\n\n## Related project\n\n- [django-email-verification](https://github.com/LeoneBacciu/django-email-verification)\n- [django-login-with-email](https://github.com/wsvincent/django-login-with-email)\n- [django-unique-user-email](https://github.com/carltongibson/django-unique-user-email)\n",
"bugtrack_url": null,
"license": null,
"summary": "A django app for login with email.",
"version": "0.6.2",
"project_urls": {
"bugs": "https://github.com/Svtter/django-login-email/issues",
"changelog": "https://github.com/Svtter/django-login-email/blob/master/CHANGELOG.md",
"homepage": "https://github.com/Svtter/django-login-email",
"repository": "https://github.com/Svtter/django-login-email.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "7a264853bab74c4cc512e07e8885d60de29b712eb561049a9be919338b233e8b",
"md5": "587ed44bf12764ae8f20e6f005411d4a",
"sha256": "239cb2ad4d90fbe09795fe7494eb285c213cfee476feec0dabac5ff0ea522f6a"
},
"downloads": -1,
"filename": "django_login_email-0.6.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "587ed44bf12764ae8f20e6f005411d4a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 27309,
"upload_time": "2025-08-15T10:24:25",
"upload_time_iso_8601": "2025-08-15T10:24:25.463101Z",
"url": "https://files.pythonhosted.org/packages/7a/26/4853bab74c4cc512e07e8885d60de29b712eb561049a9be919338b233e8b/django_login_email-0.6.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "8ad2089c1a2e97442108aed04fd82ebeaedb6ccf8bb78b485e66cfad172ca377",
"md5": "31a89b23f240ac3e9434df411a60e161",
"sha256": "d2a435629360ce6fc3e1fbcc477d5ffa115e94437026f409b1259d9ace2fb0d1"
},
"downloads": -1,
"filename": "django_login_email-0.6.2.tar.gz",
"has_sig": false,
"md5_digest": "31a89b23f240ac3e9434df411a60e161",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 18123,
"upload_time": "2025-08-15T10:24:26",
"upload_time_iso_8601": "2025-08-15T10:24:26.293331Z",
"url": "https://files.pythonhosted.org/packages/8a/d2/089c1a2e97442108aed04fd82ebeaedb6ccf8bb78b485e66cfad172ca377/django_login_email-0.6.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-15 10:24:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Svtter",
"github_project": "django-login-email",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "django-login-email"
}