Skip to main content

DJANGO 后台管理 增强

项目地址:

【Coding:】https://xqitw.coding.net/public/django-kelove-admin/django-kelove-admin/git

需要加载的应用模块

INSTALLED_APPS = [
    ...
    'mptt',
    'django_otp',
    'django_otp.plugins.otp_totp', # 可选
    'django_otp.plugins.otp_hotp', # 可选
    'django_otp.plugins.otp_static', # 可选
    'django_otp.plugins.otp_email', # 可选
    'import_export',
    'django_kelove_admin',
    ...
]

需要加载的中间件

MIDDLEWARE = [
    ...
    'django_kelove_admin.otp.middleware.OTPMiddleware',
]

需要添加的路由地址

urlpatterns = [
    ...
    path('kelove/', include('django_kelove_admin.urls')),
]

重置密码功能

  • 后台配置管理配置Email服务器

  • 根路由按以下说明修改

from django.contrib.auth.views import PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView

# 根url下添加以下路由
urlpatterns = [
    ...
    # 重置密码
    path('accounts/password_reset/', PasswordResetView.as_view(), name='admin_password_reset'),
    path('accounts/password_reset/done/', PasswordResetDoneView.as_view(), name='password_reset_done'),
    path('accounts/reset/<uidb64>/<token>/', PasswordResetConfirmView.as_view(), name='password_reset_confirm'),
    path('accounts/reset/done/', PasswordResetCompleteView.as_view(), name='password_reset_complete'),
    ...
]

新用户注册功能

  • 后台配置管理配置Email服务器

  • 添加配置

# 是否启用注册功能
REGISTRATION_OPEN = True
# 帐号激活链接有效时间(天)
ACCOUNT_ACTIVATION_DAYS = 7
  • 根路由按以下说明修改
# 根url下添加以下路由
urlpatterns = [
    ...
    # 新用户注册
    path('accounts/', include('django_registration.backends.activation.urls')),
    ...
]

Metadata

Release files for django-kelove-admin 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for django-kelove-admin 0.4.1
File Interpreter ABI Platform Actions
django_kelove_admin-0.4.1-py3-none-any.whl Python 3 none any Details for django_kelove_admin-0.4.1-py3-none-any.whl

Release files / django_kelove_admin-0.4.1-py3-none-any.whl

Download URL django_kelove_admin-0.4.1-py3-none-any.whl
Size 11.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
48816329cc41cedfb257095fdc41548222b0ac0d4d554df6b11b03da6040c45a
BLAKE2b-256 checksum
How to use checksums
e80e503dab15f6a980211ab4d622c77ccf52a573e106d7b77dd83d6e1746cedb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.7.9 Linux/4.4.0-157-generic

Security for django-kelove-admin 0.4.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page