这个项目是auth的包装器
codingsoho-auth的Python项目详细描述
编码soho auth
codingsoho auth wrapper项目是身份验证的身份验证包装器
详细文档在“docs”目录中。
快速启动
安装“authwrapper”和“django phone login”,检查django phone login自述文件中的配置
将“authWrapper”添加到已安装的应用程序设置中,如下所示:
INSTALLED_APPS=[...'authwrapper','phone_login',]
3添加配置
AUTH_USER_MODEL='authwrapper.MyUser'ACCOUNT_ALLOW_MIX_TYPE_LOGIN=TrueUUSLUGIFY=TrueAUTHENTICATION_BACKENDS=('authwrapper.backends.auth.MyBackend','authwrapper.backends.auth.WechatBackend',# if support wechat'django.contrib.auth.backends.ModelBackend',)# if support wechatAPP_SECRET=APP_ID=ACCOUNT_REGISTER_TYPE='phone'# or 'email'
- 在项目url.py中包含polls urlconf,如下所示:
url(r'^authwrapper/',include('authwrapper.urls')),
运行
python manage.py migrate
创建authwrapper模型。启动开发服务器并访问http://127.0.0.1:8000/admin/ 如果需要,创建模型(需要启用管理应用程序)。
访问http://127.0.0.1:8000/authwrapper/以参与身份验证。