summaryrefslogtreecommitdiffstats
path: root/planet/views.py
blob: d16255e0913e134c89e0df8b2bf2fcd0864d6611 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from django.shortcuts import render
from django.views.decorators.cache import cache_control

from planet.models import Feed, FeedItem, Planet


@cache_control(max_age=307)
def index(request):
    context = {
        'official_feeds': Feed.objects.all(),
        'planets': Planet.objects.all(),
        'feed_items': FeedItem.objects.order_by('-publishdate')[:25],
    }
    return render(request, 'planet/index.html', context)