Commits

vickyi committed b2c558c Draft

修改成自己的风格

Comments (0)

Files changed (4)

.settings/org.eclipse.core.resources.prefs

 eclipse.preferences.version=1
+encoding//ChineBlog/blog/forms.py=utf-8
 encoding//ChineBlog/blog/models.py=utf-8
 encoding//ChineBlog/blog/social_sync.py=utf-8
 encoding//ChineBlog/blog/urls.py=utf-8

ChineBlog/blog/models.py

         and article.share \
         and article.shares.filter(type=3).count() == 0:
         
-        content = u'残阳似血的博客发表了文章《%s》 - %s' % (article.title,
+        content = u'myblog发表了文章《%s》 - %s' % (article.title,
                                               strip_html(article.content[:100]+"..."))
         content = content.encode('utf-8')
 
     article = instance
     
     if settings.ENABLE_EMAIL:
-        subject = u'您订阅的【残阳似血的博客】上的文章有了更新'
+        subject = u'您订阅的【myblog】上的文章有了更新'
         from_email = settings.EMAIL_HOST_USER
         t = loader.get_template("blog/coolblue/subscriberemail.html")
         
         if not comment.reply_to_comment:
             to_email = [settings.ADMINS[0][1], ]
             if type == 0:
-                subject = u'【残阳似血的博客】上的文章刚刚被%s评论了' % comment.username
+                subject = u'【myblog】上的文章刚刚被%s评论了' % comment.username
             else:
-                subject = u'【残阳似血的博客】刚刚收到%s的留言' % comment.username
+                subject = u'【myblog】刚刚收到%s的留言' % comment.username
         else:
             to_email = [comment.reply_to_comment.email_address, ]
             if type == 0:
-                subject = u'您在【残阳似血的博客】上的评论刚刚被%s回复了' % comment.username
+                subject = u'您在【myblog】上的评论刚刚被%s回复了' % comment.username
             else:
-                subject = u'您在【残阳似血的博客】上的留言刚刚被%s回复了' % comment.username
+                subject = u'您在【myblog】上的留言刚刚被%s回复了' % comment.username
         
         from_email = settings.EMAIL_HOST_USER
         send_mail(subject, plain_text, from_email, to_email, html=html)

ChineBlog/blog/templates/blog/coolblue/commentform.html

 
     <div class="primary">
 
-    	<form action="{% url blog_comment %}" method="post" id="commentform">
+    	<form action="{% url blog_comment %}" method="post" id="commentform"> {% csrf_token %}
     		{{ form.avatar }}
 			{{ form.reply_to_comment }}
 			{{ form.content_type }}

ChineBlog/blog/views.py

 from django.shortcuts import render_to_response, get_object_or_404
 from django.conf import settings as settings
 from django.db.models import Q, Count, Max, Min
+#from django.views.decorators.csrf import csrf_protect
 from django.core.paginator import Paginator, EmptyPage
 from django.http import Http404, HttpResponse
 from django.contrib.contenttypes.models import ContentType
     
     return render_to_response('blog/%s/about.html' % blog_theme, data)
 
+#@csrf_protect
 def comment(request):
     response = HttpResponse()
     
+    request = RequestContext(request)
     f = CommentForm(request.POST)
     if f.is_valid():
         comment = f.save(commit=False)
         response.write("0")
     
     return response
- 
+
+#@csrf_protect 
 def comments(request, slug):       
     if slug == "bloguser":
         user_id = BlogUser.objects.get(user__username=admin).id
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.