google sso的可重用django应用程序

eckerd-django-google-sso的Python项目详细描述


eckerd django google sso
==


>一个可重复使用的django应用程序,用于google sso


安装
----


,以从pypi获得最新的稳定版本。代码块::bash

pip安装eckerd django google sso


,从github获取最新提交信息

……代码块::bash

pip install-e git+git://github.com/christopherdavenport/eckerd django google sso.git\egg=eckerd django google sso

todo:描述进一步的安装步骤(编辑/删除下面的示例):

代码块::python


installed嫒apps=(
…,
'eckerd django google sso',
'social.apps.django嫒app.default',
'django12 factor',


代码块::python

urlpatterns=[
url(r'^/',include('eckerd-django-google-sso.urls'),
]


代码块:html

{%加载后端实用程序%}




代码块::bash

./manage.py migrate



usage
----


simple wrap your content in a@login嫒required

最后在最终应用程序中将这些设置放置到位。代码块::python

authentication_backends=(
“social.backends.google.googleoauth2”,
“django.contrib.auth.backends.modelbackend”,



auth_user_model='eckerd django google sso.customuser'
session_expire_at_browser_close=true
login_url='/login/'
login_redirect_url='/'
url_path='
social_auth_strategy='social.strategies.django_strategy.djangostegy'
social_auth_storage='social.apps.django-app.default.models.djangosagestorage'



2 google oauth2(google-oauth2)
social-auth-google非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统非统_oauth2_范围=[
'https://www.googleapis.com/auth/userinfo.email',
'https://www.googleapis.com/auth/userinfo.profile'
]


social_auth_pipeline=(
“social.pipeline.social_auth.social_details”,
“social.pipeline.social_auth.social_uid”,
“social.pipeline.social_auth.auth_allowed”,
“social.pipeline.social_auth.associate_by_email”、
“social.pipeline.social_auth.social_user”、
“social.pipeline.user.get_username”、
“social.pipeline.user.create_user”、
“social.pipeline.social_auth.associate_user”、
“social.pipeline.social_auth.load_extra_data”,
“social.pipeline.user.user_details”




“social_auth_admin_search_fields=['名字','姓氏','电子邮件',
“用户名”]



自定义设置=(
“social_auth_google_oauth2_key”,
“social_auth_google_oauth2_secret”,


import django12 factor

d12f=django12 factor.factorse(自定义设置=自定义设置)
databases=d12f['databases']
secret_key=d12f['secret_key']
social_auth_google_oauth2_key=d12f['social_auth_google_oauth2_key']
social_auth_google_oauth2_secret=D12F['Social_Auth_Google_OAuth2_Secret']
Allowed_hosts=D12F['Allowed_hosts']
debug=D12F['debug']
logging=D12F['logging']


-

如果您想参与此项目,请执行以下步骤

。代码块::bash

/>#克隆你的fork
mkvirtualenv-p python2.7 eckerd django google sso
make development

git co-b feature\u branch master
&;git commit
git push-u origin feature\u branch
向我们发送功能分支的拉取请求

要运行测试,只需执行“tox”。这将安装两个新的
环境(用于django 1.8和django 1.9),并对这两个
环境运行测试。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java使用prepared语句在oracle中插入日期   对点具有双重值的java   使用多个通配符的java请求映射   java Springboot为什么要设置springbootstartertomcat   除了对JavaBean的请求之外,还使用servletContext的servlet   java如何清除OCSID。返回到池的连接时的CLIENTID JDBC客户端信息属性   将整型数组转换为光栅Java   java使用对象引用作为互斥锁   java为什么在编程语言中使用sin函数返回奇怪的sin值不像计算器   java如何将JButton链接到对象并调用相关方法   php用Java发送POST数据   导航属性的java模拟加载   java多个活动错误Android试图对空对象引用调用虚拟方法“”   java Android更改ActionBar文本颜色   如何使用带有java反射且不带开关的parant引用创建子类