Spaces:
Sleeping
Sleeping
File size: 372 Bytes
8f3df84 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
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})
|