source: MILK/trunk/milk_server/milk_server/controllers/ @ 4468

Subversion URL:
Revision 4468, 1.0 KB checked in by cbyrom, 12 years ago (diff)

Strip out code not relevant to MILK - mainly WCS and WMS stuff - also including the CSML server code + trackback code
Also tidy up structure of 'public' dir - setting up new 'style' dir and
centralising icons in icons dir + remove all unused icons, javascript and stylesheets.
Also strip out testcase code and populate new test directory structure.

1from milk_server.lib.base import *
3class TemplateController(BaseController):
4    def view(self, url):
5        """
6        This is the last place which is tried during a request to try to find a
7        file to serve. It could be used for example to display a template::
9            def view(self, url):
10                return render_response(url)
12        Or, if you're using Myghty and would like to catch the component not
13        found error which will occur when the template doesn't exist; you
14        can use the following version which will provide a 404 if the template
15        doesn't exist::
17            import myghty.exception
19            def view(self, url):
20                try:
21                    return render_response('/'+url)
22                except myghty.exception.ComponentNotFound:
23                    return Response(code=404)
25        The default is just to abort the request with a 404 File not found
26        status message.
27        """
28        abort(404)
Note: See TracBrowser for help on using the repository browser.