added favicon plus func, unpub posts only visible to admin
This commit is contained in:
parent
4195802ace
commit
83b28f4475
|
@ -2,6 +2,7 @@ from blogapp.models import blogentry, blogcomment, blogcategory
|
||||||
from django.shortcuts import render, get_object_or_404
|
from django.shortcuts import render, get_object_or_404
|
||||||
# from django.template import RequestContext
|
# from django.template import RequestContext
|
||||||
from django import forms
|
from django import forms
|
||||||
|
from django.http import Http404
|
||||||
from polysite.globals import CustomRenderer
|
from polysite.globals import CustomRenderer
|
||||||
import datetime
|
import datetime
|
||||||
import mistune
|
import mistune
|
||||||
|
@ -28,6 +29,10 @@ def list_category(request, category_id):
|
||||||
def detail(request, blogentry_id):
|
def detail(request, blogentry_id):
|
||||||
|
|
||||||
blogdetail = get_object_or_404(blogentry, pk=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':
|
if request.method == 'POST':
|
||||||
fml = BlogCommentForm(request.POST)
|
fml = BlogCommentForm(request.POST)
|
||||||
if fml.is_valid():
|
if fml.is_valid():
|
||||||
|
|
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
|
@ -3,6 +3,7 @@
|
||||||
<head>
|
<head>
|
||||||
{% load static %}
|
{% load static %}
|
||||||
<link rel="stylesheet" type="text/css" href="{% static "general.css" %}" />
|
<link rel="stylesheet" type="text/css" href="{% static "general.css" %}" />
|
||||||
|
<link rel="shortcut icon" href="{% static "favicon.ico" %}" />
|
||||||
{% block head %}{% endblock %}
|
{% block head %}{% endblock %}
|
||||||
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"/>
|
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"/>
|
||||||
<title>polylux</title>
|
<title>polylux</title>
|
||||||
|
|
Loading…
Reference in New Issue