MistryBox / Boxes /views.py
NitinBot001's picture
Upload 130 files
4b2adab verified
raw
history blame
398 Bytes
from django.shortcuts import render, get_object_or_404
from .models import MysteryBox
def all_boxes(request):
boxes = MysteryBox.objects.all()
return render(request, "Boxes/templates/all_boxes.html", {"boxes": boxes})
def box_detail(request, pk):
box = get_object_or_404(MysteryBox, pk=pk)
return render(request, "Boxes/templates/box_detail.html", {"box": box})