a Django-based indieweb.org site https://00dani.me/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
675 B

from annoying.decorators import render_to
from django.shortcuts import redirect
from .models import Entry
def index(request, kind):
entries = Entry.objects.filter(kind=kind.id)
return {
'entries': entries,
'atom': 'entries:' + kind.atom,
'rss': 'entries:' + kind.rss,
'title': kind.plural,
def entry(request, id, slug=None):
entry = Entry.objects.get(pk=id)
if request.path != entry.url:
return redirect(entry.url, permanent=True)
return {
'entry': entry,
'title': entry.title,
'meta': entry.as_meta(request)