Display template, book list, and admin page changes.

This commit is contained in:
Mike Young
2019-11-17 10:22:17 -05:00
parent 5f41716b63
commit 5255eff365
3 changed files with 31 additions and 10 deletions

View File

@@ -1,7 +1,15 @@
from django.http import HttpResponse
from django.shortcuts import render
# Create your views here.
from .models import Books
def index(request):
return HttpResponse("HTTP Request")
return render(request, "index.html", {'Books': Books.objects.all()})
def book_set(_set):
r = 20
x = _set*r
y = x + r
books = Books.objects.all()[x:y]
return books