diff --git a/blogapp/views.py b/blogapp/views.py index 919267d..7c97fcc 100644 --- a/blogapp/views.py +++ b/blogapp/views.py @@ -2,6 +2,7 @@ from blogapp.models import blogentry, blogcomment, blogcategory from django.shortcuts import render, get_object_or_404 # from django.template import RequestContext from django import forms +from django.http import Http404 from polysite.globals import CustomRenderer import datetime import mistune @@ -28,6 +29,10 @@ def list_category(request, category_id): def detail(request, blogentry_id): blogdetail = get_object_or_404(blogentry, pk=blogentry_id) + + if not blogdetail.published and not request.user.is_authenticated(): + raise Http404("") + if request.method == 'POST': fml = BlogCommentForm(request.POST) if fml.is_valid(): diff --git a/db.sqlite3 b/db.sqlite3 index 7737295..3fd3ea8 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000..ab8a8d4 Binary files /dev/null and b/static/favicon.ico differ diff --git a/templates/base.html b/templates/base.html index fd3ff90..15157e4 100644 --- a/templates/base.html +++ b/templates/base.html @@ -3,6 +3,7 @@ {% load static %} + {% block head %}{% endblock %} polylux