depot/web/quotes/quotedb/views.py

15 lines
274 B
Python
Raw Normal View History

2021-01-19 03:51:22 +00:00
from django.shortcuts import render
2021-01-20 22:20:07 +00:00
from . import models
2021-01-19 03:51:22 +00:00
def home(request):
2021-01-20 22:20:07 +00:00
random_quote = models.Quote.objects.all().order_by("?").first()
return render(
request,
"quotedb/home.html",
{
"quote": random_quote,
},
)