增加了讨论区的 SSO 登录

This commit is contained in:
virusdefender
2015-10-20 20:09:23 +08:00
parent da54a1245b
commit 17f1820955
6 changed files with 43 additions and 30 deletions

View File

@@ -11,18 +11,13 @@ DATABASES = {
},
# submission 的 name 和 engine 请勿修改,其他代码会用到
'submission': {
'NAME': 'oj_submission',
'ENGINE': 'django.db.backends.mysql',
'CONN_MAX_AGE': 0.1,
'HOST': "127.0.0.1",
'PORT': 3306,
'USER': 'root',
'PASSWORD': 'root',
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db1.sqlite3'),
}
}
REDIS_CACHE = {
"host": "121.42.32.129",
"host": "127.0.0.1",
"port": 6379,
"db": 1
}
@@ -36,4 +31,6 @@ ALLOWED_HOSTS = []
STATICFILES_DIRS = [os.path.join(BASE_DIR, "static/src/"), BASE_DIR]
# 模板文件夹
TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'template/src/')]
TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'template/src/')]
SSO = {"callback": "http://localhost:8765/login"}

View File

@@ -43,3 +43,5 @@ STATICFILES_DIRS = [os.path.join(BASE_DIR, "static/release/"), os.path.join(BASE
TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'template/release/')]
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
SSO = {"callback": "https://discuss.acmer.site/login"}

View File

@@ -6,7 +6,7 @@ from django.views.generic import TemplateView
from account.views import (UserLoginAPIView, UsernameCheckAPIView, UserRegisterAPIView,
UserChangePasswordAPIView, EmailCheckAPIView,
UserAdminAPIView, UserInfoAPIView,
ApplyResetPasswordAPIView)
ApplyResetPasswordAPIView, SSOAPIView)
from announcement.views import AnnouncementAdminAPIView
@@ -127,7 +127,7 @@ urlpatterns = [
url(r'^account/settings/$', TemplateView.as_view(template_name="oj/account/settings.html"), name="account_setting_page"),
url(r'^account/settings/avatar/$', TemplateView.as_view(template_name="oj/account/avatar.html"), name="avatar_settings_page"),
url(r'^account/auth/$', "account.views.auth_page", name="auth_login_page"),
url(r'^account/sso/$', SSOAPIView.as_view(), name="sso_api"),
]