MistryBox / Boxes /views.py
NitinBot001's picture
Update Boxes/views.py
8f3df84 verified
from django.shortcuts import render, get_object_or_404
from .models import MysteryBox
def all_boxes(request):
boxes = MysteryBox.objects.all()
return render(request, "templates/all_boxes.html", {"boxes": boxes})
def box_detail(request, pk):
box = get_object_or_404(MysteryBox, pk=pk)
return render(request, "templates/box_detail.html", {"box": box})