1 # -*- coding: utf-8 -*-
2 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
5 from django.shortcuts import render, get_object_or_404
6 from django.template import RequestContext, Template, TemplateSyntaxError
8 from infopages.models import InfoPage
11 def infopage(request, slug):
12 page = get_object_or_404(InfoPage, slug=slug)
13 rc = RequestContext(request)
15 left_column = Template(page.left_column).render(rc)
16 except TemplateSyntaxError:
20 right_column = Template(page.right_column).render(rc)
21 except TemplateSyntaxError:
24 return render(request, 'infopages/infopage.html', {
26 'left_column': left_column,
27 'right_column': right_column,