heroku
This commit is contained in:
parent
18b3cf4583
commit
dcbda009fa
@ -2,6 +2,7 @@
|
|||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from .models import Post
|
from .models import Post
|
||||||
from django.db.models import Count, Max, Min, Q
|
from django.db.models import Count, Max, Min, Q
|
||||||
|
from django.http import HttpResponse
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.shortcuts import render, get_object_or_404, render_to_response
|
from django.shortcuts import render, get_object_or_404, render_to_response
|
||||||
from django.shortcuts import redirect
|
from django.shortcuts import redirect
|
||||||
@ -30,7 +31,7 @@ def cloud():
|
|||||||
|
|
||||||
|
|
||||||
def post_list(request, page='1', tag=None):
|
def post_list(request, page='1', tag=None):
|
||||||
print('lalala')
|
|
||||||
if tag is None:
|
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]
|
post_list = Post.objects.filter(published_date__lte=timezone.now()).order_by('-published_date')#[int(page)*5-5:int(page)*5]
|
||||||
else:
|
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.
|
except EmptyPage: # If page is out of range (e.g. 9999), deliver last page of results.
|
||||||
posts = paginator.page(paginator.num_pages)
|
posts = paginator.page(paginator.num_pages)
|
||||||
#print dir(posts.paginator)
|
#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):
|
def post_detail(request, pk):
|
||||||
post = get_object_or_404(Post, pk=pk)
|
post = get_object_or_404(Post, pk=pk)
|
||||||
|
Loading…
Reference in New Issue
Block a user