initial movies app

This commit is contained in:
2026-02-28 13:04:19 -05:00
parent b1c9b88de1
commit fc715c3ced
15 changed files with 197 additions and 1 deletions

18
apps/movies/views.py Normal file
View File

@@ -0,0 +1,18 @@
from django.http import HttpResponse
from django.shortcuts import render
from django.views import generic
from .models import Movie
def index(request):
return HttpResponse("Hello, world. You're at the movies index.")
class IndexView(generic.ListView):
template_name = "movies/index.html"
context_object_name = "latest_movies"
def get_queryset(self):
"""Return the last five published questions."""
return Movie.objects.order_by("-added_date")[:5]