From dcbda009fadb75652450de7c8218a11c0c514e24 Mon Sep 17 00:00:00 2001 From: Date: Fri, 8 Dec 2017 02:31:35 +0300 Subject: [PATCH] heroku --- blog/views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/blog/views.py b/blog/views.py index e8335ba..0b9f5a5 100644 --- a/blog/views.py +++ b/blog/views.py @@ -2,6 +2,7 @@ from django.shortcuts import render from .models import Post from django.db.models import Count, Max, Min, Q +from django.http import HttpResponse from django.utils import timezone from django.shortcuts import render, get_object_or_404, render_to_response from django.shortcuts import redirect @@ -30,7 +31,7 @@ def cloud(): def post_list(request, page='1', tag=None): - print('lalala') + if tag is None: post_list = Post.objects.filter(published_date__lte=timezone.now()).order_by('-published_date')#[int(page)*5-5:int(page)*5] else: @@ -51,8 +52,8 @@ def post_list(request, page='1', tag=None): except EmptyPage: # If page is out of range (e.g. 9999), deliver last page of results. posts = paginator.page(paginator.num_pages) #print dir(posts.paginator) - return render_to_response('blog/post_list.html', {'posts': posts, 'latest': latest, 'cloud': tag_cloud, 'search_query': search_query}) - + # return render_to_response('blog/post_list.html', {'posts': posts, 'latest': latest, 'cloud': tag_cloud, 'search_query': search_query}) + return HttpResponse('HELLO') def post_detail(request, pk): post = get_object_or_404(Post, pk=pk)