(;) Semicolon Math is a platform that offers math contests every month with 2 easy, 2 medium, and 2 hard AIME level problems. The format is similar to contests you will find on some competitive programming contests. https://scmath.herokuapp.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
685 B

from django.core.paginator import Paginator
from django.shortcuts import render
from django.http import HttpResponse
from .models import Post
def home(request):
posts = Post.objects.all().order_by('-id')
paginator = Paginator(posts, 5)
page_number = request.GET.get('page')
page_obj = paginator.get_page(page_number)
context = {
'page_obj': page_obj
return render(request, 'blog/home.html', context)
def view_post(request, index):
post = Post.objects.get(pk=index)
context = {
'post': post
return render(request, 'blog/view_post.html', context)
def about(request):
return render(request, 'blog/about.html')