def foo(reguest, page_number=1):
all_foo = BlogPost.objects.all()
current_page = Paginator(all_foo, 5)
return render_to_response('foo.html', {'te': current_page.page(page_number), 'username': auth.get_user(reguest).username})
url(r'^$', foo),
published = models.BooleanField(default=False, verbose_name='Опубликован')
def full_slug(reguest, slug):
comment_form = CommentForm
form = comment_form
te = get_object_or_404(BlogPost, slug=slug)
comments = Comments.objects.filter(comments_blogpost=te)
post = BlogPost.objects.filter(published=True)
return render(reguest, 'full.html',
{'te': te,
'form': form,
'comments': comments,
'post': post,
'username': auth.get_user(reguest).username})