depot/web/quotes/quotedb/views.py

14 lines
274 B
Python

from django.shortcuts import render
from . import models
def home(request):
random_quote = models.Quote.objects.all().order_by("?").first()
return render(
request,
"quotedb/home.html",
{
"quote": random_quote,
},
)