Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (15 sloc) 530 Bytes
from __future__ import unicode_literals
from django.shortcuts import get_object_or_404, render
from .models import Page
from .renderer import renderer
def page_detail(request, path=None):
page = get_object_or_404(
Page.objects.active(),
path='/{}/'.format(path) if path else '/',
)
page.activate_language(request)
return render(request, page.template.template_name, {
'page': page,
'regions': renderer.regions(
page, inherit_from=page.ancestors().reverse()),
})