Blame | Last modification | View Log | RSS feed
# -*- coding: utf-8 -*-"""Fallback controller."""from wiki20.lib.base import BaseController__all__ = ['TemplateController']class TemplateController(BaseController):"""The fallback controller for Wiki-20.By default, the final controller tried to fulfill the requestwhen no other routes match. It may be used to display a templatewhen all else fails, e.g.::def view(self, url):return render('/%s' % url)Or if you're using Mako and want to explicitly send a 404 (NotFound) response code when the requested template doesn't exist::import mako.exceptionsdef view(self, url):try:return render('/%s' % url)except mako.exceptions.TopLevelLookupException:abort(404)"""def view(self, url):"""Abort the request with a 404 HTTP status code."""abort(404)