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),并对这两个
环境运行测试。
==
>一个可重复使用的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),并对这两个
环境运行测试。