+from django.contrib.comments.moderation import CommentModerator, moderator
from django.db import models
from django.conf import settings
from django.contrib import admin
class Meta:
ordering = ['-publish_date']
+class BlogEntryCommentModerator(CommentModerator):
+ email_notification = True
+
+ def moderate(self, comment, content_object, request):
+ return True
+
+moderator.register(BlogEntry, BlogEntryCommentModerator)
+
class BlogSection(models.Model):
title = models.CharField(max_length=150)
slug = models.SlugField()
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.doc.XViewMiddleware',
)