Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
25 lines (21 sloc) 647 Bytes
from __future__ import unicode_literals
from django.shortcuts import get_object_or_404, render
from feincms3.regions import Regions
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": Regions.from_item(
page, renderer=renderer, inherit_from=page.ancestors().reverse()
),
},
)