render_to base html def dispath request slug page get_object_or_404 Pa

1
2
3
4
5
6
7
@render_to('base.html')
def dispath(request, slug):
page = get_object_or_404(Page.on_site, url=slug)
ct = page.content_type
auto_tpl = '%s/%s_view.html' % (ct.app_label, ct.model)
obj = p.content_object
return (p.template or auto_tpl, {'object': obj, 'page_object': page})