def display_page(request, virtual_path):
 page = None
 for page_model in AbstractPage.__subclasses__():
  try:
   page = page_model.objects.live(request.user).get(virtual_path=virtual_path)
  except ObjectDoesNotExist:
   pass
 if (page is None):
  raise Http404
 if page.url:
  return redirect(page.url)
 template_name = 'staticpages/page_display.html'
 if request.is_ajax():
  template_name = 'staticpages/_body.html'
 ctx = {'page': page}
 return render(request, template_name, ctx)

def display_page ( request , virtual_path ) : page = None for page_model in AbstractPage . __subclasses__ ( ) : try : page = page_model . objects . live ( request . user ) . get ( virtual_path = virtual_path ) except ObjectDoesNotExist : pass if ( page is None ) : raise Http404 if page . url : return redirect ( page . url ) template_name = 'staticpages/page_display.html' if request . is_ajax ( ) : template_name = 'staticpages/_body.html' ctx = { 'page' : page } return render ( request , template_name , ctx )
displays an active page defined in virtual_path .