added favicon plus func, unpub posts only visible to admin

This commit is contained in:
ottona 2018-03-04 00:45:23 +01:00
parent 4195802ace
commit 83b28f4475
4 changed files with 6 additions and 0 deletions

View File

@ -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():

Binary file not shown.

BIN
static/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -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>