phantasma/app/text/views.py
2021-09-28 15:10:22 +02:00

21 lines
598 B
Python

from django.shortcuts import render, redirect, get_object_or_404
from . import models
def index(request):
context = {}
return render(request, 'index.html', context)
def about(request):
context = {}
return render(request, 'about.html', context)
def essays(request):
context = {}
context['essays'] = models.Essay.objects.filter(public=True).order_by('created')
return render(request, 'essays.html', context)
def essay(request, slug):
context = {}
context['essay'] = get_object_or_404(models.Essay, slug=slug)
return render(request, 'essay.html', context)