event-timeline/app/event/views.py

15 lines
469 B
Python
Raw Normal View History

2021-11-12 16:49:35 +00:00
from django.shortcuts import render
2021-11-12 16:58:31 +00:00
from django.conf import settings
2021-11-12 16:49:35 +00:00
from .models import Event
from ..page.models import Page
def index(request, slug=''):
context = {}
2021-11-12 16:58:31 +00:00
context['settings'] = settings
2021-11-12 16:49:35 +00:00
context['events'] = Event.objects.all().order_by('position')
2021-11-12 18:03:19 +00:00
context['postscript'], c = Page.objects.get_or_create(slug='postscript')
context['intro'], c = Page.objects.get_or_create(slug='intro')
2021-11-12 16:49:35 +00:00
return render(request, 'index.html', context)