Skip to main content

DJANGO 后台管理 增强

Project description

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')),
    ...
]

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

django_kelove_admin-0.4.1-py3-none-any.whl (11.0 MB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for django_kelove_admin-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 48816329cc41cedfb257095fdc41548222b0ac0d4d554df6b11b03da6040c45a
MD5 96d6f833232cb56482628363be365d6e
BLAKE2b-256 e80e503dab15f6a980211ab4d622c77ccf52a573e106d7b77dd83d6e1746cedb

See more details on using hashes here.

Supported by

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