Skip to content

Commit 69819ff

Browse files
committed
第三方登录
1 parent 0d01e58 commit 69819ff

File tree

5 files changed

+22
-6
lines changed

5 files changed

+22
-6
lines changed

DjangoBlog/settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# DEBUG = False
2727

2828
# ALLOWED_HOSTS = []
29-
ALLOWED_HOSTS = ['www.lylinux.net', '127.0.0.1']
29+
ALLOWED_HOSTS = ['www.lylinux.net', '127.0.0.1','example.com']
3030
# Application definition
3131

3232
INSTALLED_APPS = [

blog/static/blog/css/style.css

+3
Original file line numberDiff line numberDiff line change
@@ -1998,6 +1998,9 @@ div {
19981998
#wp-auto-top-bottom:hover {
19991999
background-position: right -68px;
20002000
}
2001+
.widget-login{
2002+
margin-top: 15px!important;
2003+
}
20012004

20022005
/* ------------------------------------------------------------------------- *
20032006
* Comments

templates/blog/article_detail.html

+11-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,17 @@ <h3 class="assistive-text">文章导航</h3>
4545
{% comment %}{% load comments_tags %}
4646
{% load_post_comment article from %}{% endcomment %}
4747
{% include 'comments/tags/comment_list.html' %}
48-
{% include 'comments/tags/post_comment.html' %}
48+
{% if user.is_authenticated %}
49+
{% include 'comments/tags/post_comment.html' %}
50+
{% else %}
51+
<div class="comments-area">
52+
<h3 class="comment-meta">您还没有登录,请您<a href="{% url "account:login" %}">登录</a>后发表评论。</h3>
53+
54+
{% load oauth_tags %}
55+
{% load_oauth_applications %}
56+
57+
</div>
58+
{% endif %}
4959
{% endif %}
5060
</div><!-- #primary -->
5161

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
<div>
1+
<div class="widget-login">
2+
<small>
3+
快捷登录:
4+
</small>
25
{% for icon,url in apps %}
3-
<a href="{{ url }}">
6+
<a href="{{ url }}" rel="nofollow">
47
<span class="icon-sn-{{ icon }}"></span>
58
</a>
69
{% endfor %}
7-
</div>
10+
</div>

templates/share_layout/base.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{% block header %}
1818
{% endblock %}
1919
<link rel="profile" href="http://gmpg.org/xfn/11"/>
20-
{% comment %}<link rel="pingback" href="https://www.lylinux.org/xmlrpc.php"/>{% endcomment %}
20+
2121
<!--[if lt IE 9]>
2222
<script src="{% static 'blog/js/html5.js' %}" type="text/javascript"></script>
2323
<![endif]-->

0 commit comments

Comments
 (0)