Skip to content

Commit ea09e9a

Browse files
committed
oauth功能,暂存
1 parent 9234851 commit ea09e9a

File tree

11 files changed

+464
-345
lines changed

11 files changed

+464
-345
lines changed

DjangoBlog/settings.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
SECRET_KEY = '&3g0bdza#c%dm1lf%5gi&0-*53p3t0m*hmcvo29cn^$ji7je(c'
2323

2424
# SECURITY WARNING: don't run with debug turned on in production!
25-
#DEBUG = True
26-
DEBUG = False
25+
DEBUG = True
26+
# DEBUG = False
2727

2828
# ALLOWED_HOSTS = []
2929
ALLOWED_HOSTS = ['www.lylinux.net', '127.0.0.1']
@@ -51,9 +51,9 @@
5151
'django.middleware.security.SecurityMiddleware',
5252
'django.contrib.sessions.middleware.SessionMiddleware',
5353
'django.middleware.gzip.GZipMiddleware',
54-
#'django.middleware.cache.UpdateCacheMiddleware',
54+
# 'django.middleware.cache.UpdateCacheMiddleware',
5555
'django.middleware.common.CommonMiddleware',
56-
#'django.middleware.cache.FetchFromCacheMiddleware',
56+
# 'django.middleware.cache.FetchFromCacheMiddleware',
5757
'django.middleware.csrf.CsrfViewMiddleware',
5858
'django.contrib.auth.middleware.AuthenticationMiddleware',
5959
'django.contrib.messages.middleware.MessageMiddleware',
@@ -208,6 +208,11 @@
208208
'appkey': os.environ.get('GOOGLE_APP_KEY'),
209209
'appsecret': os.environ.get('GOOGLE_APP_SECRET'),
210210
'callbackurl': 'http://www.lylinux.net/oauth/googleauthorize'
211+
},
212+
'github': {
213+
'appkey': os.environ.get('GITHUB_APP_KEY'),
214+
'appsecret': os.environ.get('GITHUB_APP_SECRET'),
215+
'callbackurl': 'http://www.lylinux.net/oauth/githubauthorize'
211216
}
212217
}
213218

Lines changed: 305 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,305 @@
1+
2+
.icon-sn-google {
3+
background-position: 0 -28px;
4+
}
5+
6+
.icon-sn-bg-google {
7+
background-color: #4285f4;
8+
background-position: 0 0;
9+
}
10+
11+
.fa-sn-google {
12+
color: #4285f4;
13+
}
14+
15+
.icon-sn-github {
16+
background-position: -28px -28px;
17+
}
18+
19+
.icon-sn-bg-github {
20+
background-color: #333;
21+
background-position: -28px 0;
22+
}
23+
24+
.fa-sn-github {
25+
color: #333;
26+
}
27+
28+
.icon-sn-weibo {
29+
background-position: -56px -28px;
30+
}
31+
32+
.icon-sn-bg-weibo {
33+
background-color: #e90d24;
34+
background-position: -56px 0;
35+
}
36+
37+
.fa-sn-weibo {
38+
color: #e90d24;
39+
}
40+
41+
.icon-sn-qq {
42+
background-position: -84px -28px;
43+
}
44+
45+
.icon-sn-bg-qq {
46+
background-color: #0098e6;
47+
background-position: -84px 0;
48+
}
49+
50+
.fa-sn-qq {
51+
color: #0098e6;
52+
}
53+
54+
.icon-sn-twitter {
55+
background-position: -112px -28px;
56+
}
57+
58+
.icon-sn-bg-twitter {
59+
background-color: #50abf1;
60+
background-position: -112px 0;
61+
}
62+
63+
.fa-sn-twitter {
64+
color: #50abf1;
65+
}
66+
67+
.icon-sn-facebook {
68+
background-position: -140px -28px;
69+
}
70+
71+
.icon-sn-bg-facebook {
72+
background-color: #4862a3;
73+
background-position: -140px 0;
74+
}
75+
76+
.fa-sn-facebook {
77+
color: #4862a3;
78+
}
79+
80+
.icon-sn-renren {
81+
background-position: -168px -28px;
82+
}
83+
84+
.icon-sn-bg-renren {
85+
background-color: #197bc8;
86+
background-position: -168px 0;
87+
}
88+
89+
.fa-sn-renren {
90+
color: #197bc8;
91+
}
92+
93+
.icon-sn-tqq {
94+
background-position: -196px -28px;
95+
}
96+
97+
.icon-sn-bg-tqq {
98+
background-color: #1f9ed2;
99+
background-position: -196px 0;
100+
}
101+
102+
.fa-sn-tqq {
103+
color: #1f9ed2;
104+
}
105+
106+
.icon-sn-douban {
107+
background-position: -224px -28px;
108+
}
109+
110+
.icon-sn-bg-douban {
111+
background-color: #279738;
112+
background-position: -224px 0;
113+
}
114+
115+
.fa-sn-douban {
116+
color: #279738;
117+
}
118+
119+
.icon-sn-weixin {
120+
background-position: -252px -28px;
121+
}
122+
123+
.icon-sn-bg-weixin {
124+
background-color: #00b500;
125+
background-position: -252px 0;
126+
}
127+
128+
.fa-sn-weixin {
129+
color: #00b500;
130+
}
131+
132+
.icon-sn-dotted {
133+
background-position: -280px -28px;
134+
}
135+
136+
.icon-sn-bg-dotted {
137+
background-color: #eee;
138+
background-position: -280px 0;
139+
}
140+
141+
.fa-sn-dotted {
142+
color: #eee;
143+
}
144+
145+
.icon-sn-site {
146+
background-position: -308px -28px;
147+
}
148+
149+
.icon-sn-bg-site {
150+
background-color: #00b500;
151+
background-position: -308px 0;
152+
}
153+
154+
.fa-sn-site {
155+
color: #00b500;
156+
}
157+
158+
.icon-sn-linkedin {
159+
background-position: -336px -28px;
160+
}
161+
162+
.icon-sn-bg-linkedin {
163+
background-color: #0077b9;
164+
background-position: -336px 0;
165+
}
166+
167+
.fa-sn-linkedin {
168+
color: #0077b9;
169+
}
170+
171+
[class*=icon-sn-] {
172+
display: inline-block;
173+
background-image: url('../img/icon-sn.svg');
174+
background-repeat: no-repeat;
175+
width: 28px;
176+
height: 28px;
177+
vertical-align: middle;
178+
background-size: auto 56px;
179+
}
180+
181+
[class*=icon-sn-]:hover {
182+
opacity: .8;
183+
filter: alpha(opacity=80);
184+
}
185+
186+
.btn-sn-google {
187+
background: #4285f4;
188+
}
189+
190+
.btn-sn-google:active, .btn-sn-google:focus, .btn-sn-google:hover {
191+
background: #2a75f3;
192+
}
193+
194+
.btn-sn-github {
195+
background: #333;
196+
}
197+
198+
.btn-sn-github:active, .btn-sn-github:focus, .btn-sn-github:hover {
199+
background: #262626;
200+
}
201+
202+
.btn-sn-weibo {
203+
background: #e90d24;
204+
}
205+
206+
.btn-sn-weibo:active, .btn-sn-weibo:focus, .btn-sn-weibo:hover {
207+
background: #d10c20;
208+
}
209+
210+
.btn-sn-qq {
211+
background: #0098e6;
212+
}
213+
214+
.btn-sn-qq:active, .btn-sn-qq:focus, .btn-sn-qq:hover {
215+
background: #0087cd;
216+
}
217+
218+
.btn-sn-twitter {
219+
background: #50abf1;
220+
}
221+
222+
.btn-sn-twitter:active, .btn-sn-twitter:focus, .btn-sn-twitter:hover {
223+
background: #38a0ef;
224+
}
225+
226+
.btn-sn-facebook {
227+
background: #4862a3;
228+
}
229+
230+
.btn-sn-facebook:active, .btn-sn-facebook:focus, .btn-sn-facebook:hover {
231+
background: #405791;
232+
}
233+
234+
.btn-sn-renren {
235+
background: #197bc8;
236+
}
237+
238+
.btn-sn-renren:active, .btn-sn-renren:focus, .btn-sn-renren:hover {
239+
background: #166db1;
240+
}
241+
242+
.btn-sn-tqq {
243+
background: #1f9ed2;
244+
}
245+
246+
.btn-sn-tqq:active, .btn-sn-tqq:focus, .btn-sn-tqq:hover {
247+
background: #1c8dbc;
248+
}
249+
250+
.btn-sn-douban {
251+
background: #279738;
252+
}
253+
254+
.btn-sn-douban:active, .btn-sn-douban:focus, .btn-sn-douban:hover {
255+
background: #228330;
256+
}
257+
258+
.btn-sn-weixin {
259+
background: #00b500;
260+
}
261+
262+
.btn-sn-weixin:active, .btn-sn-weixin:focus, .btn-sn-weixin:hover {
263+
background: #009c00;
264+
}
265+
266+
.btn-sn-dotted {
267+
background: #eee;
268+
}
269+
270+
.btn-sn-dotted:active, .btn-sn-dotted:focus, .btn-sn-dotted:hover {
271+
background: #e1e1e1;
272+
}
273+
274+
.btn-sn-site {
275+
background: #00b500;
276+
}
277+
278+
.btn-sn-site:active, .btn-sn-site:focus, .btn-sn-site:hover {
279+
background: #009c00;
280+
}
281+
282+
.btn-sn-linkedin {
283+
background: #0077b9;
284+
}
285+
286+
.btn-sn-linkedin:active, .btn-sn-linkedin:focus, .btn-sn-linkedin:hover {
287+
background: #0067a0;
288+
}
289+
290+
[class*=btn-sn-], [class*=btn-sn-]:active, [class*=btn-sn-]:focus, [class*=btn-sn-]:hover {
291+
border: none;
292+
color: #fff;
293+
}
294+
295+
.btn-sn-more {
296+
padding: 0;
297+
}
298+
299+
.btn-sn-more, .btn-sn-more:active, .btn-sn-more:hover {
300+
box-shadow: none;
301+
}
302+
303+
[class*=btn-sn-] [class*=icon-sn-] {
304+
background-color: transparent;
305+
}

0 commit comments

Comments
 (0)