Added initial homepage view.

pull/1/head
Calum Andrew Morrell 2025-02-16 23:39:00 +00:00
parent d665992b22
commit c6b834e5b7
1 changed files with 14 additions and 1 deletions

View File

@ -1 +1,14 @@
# Create your views here.
from django.views.generic import TemplateView
from articles.models import Article
class Homepage(TemplateView):
template_name = 'core/homepage.html'
def get_context_data(self, **kwargs):
context = super(Homepage, self).get_context_data()
context['featured_articles'] = Article.objects.filter(is_featured=True)
return context
# TODO: place a random website link on the homepage