Code Monkey home page Code Monkey logo

django-simpleui-captcha's Introduction

django-simpleui-captcha

PyPI version

django-simpleui-captcha 是一个 django 后台管理登录验证码插件

界面

image

安装

pip install django-simpleui-captcha

依赖

  • Django
  • django-simple-captcha

快速开始

1. 添加 "simpleui_captcha" 到 INSTALLED_APPS 设置, 注意要放在最前面

INSTALLED_APPS = [
    "simpleui_captcha",
    "simpleui",
    ... 
]

2. 添加 simpleui_captchaurl 到你的项目 urls.py ::

path('simpleui_captcha/', include('simpleui_captcha.urls')),

3. 运行 python manage.py migrate 迁移验证码模型

4.(可选)后台在连续登录n次失败后,要求输入验证码登录

# urls.py
from simpleui_captcha.views import LoginWithCaptcha


urlpatterns = [
    path('admin/login/', LoginWithCaptcha.as_view(), name='admin_login'),
    path('admin/', admin.site.urls),
    ...
]

# settings.py 默认值
SIMPLEUI_CAPTCHA = {
    'FAILED_LOGIN_COUNT_NAME': 'failed_login_count', # session 的键名
    'MAX_FAILED_LOGIN_COUNT': 3, # 不需要输验证码的最大失败次数
}

django-simpleui-captcha's People

Contributors

dust8 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.