1d0825bca7fe65beaee391d30da42e937db621564Steve Block# Copyright (C) 2010 Google Inc. All rights reserved.
2231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#
3231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# Redistribution and use in source and binary forms, with or without
4231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# modification, are permitted provided that the following conditions are
5231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# met:
6dd8bb3de4f353a81954234999f1fea748aee2ea9Ben Murdoch#
7231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#     * Redistributions of source code must retain the above copyright
8231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# notice, this list of conditions and the following disclaimer.
9231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#     * Redistributions in binary form must reproduce the above
10231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# copyright notice, this list of conditions and the following disclaimer
11231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# in the documentation and/or other materials provided with the
12231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# distribution.
13231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#     * Neither the name of Google Inc. nor the names of its
14231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# contributors may be used to endorse or promote products derived from
15231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# this software without specific prior written permission.
16dd8bb3de4f353a81954234999f1fea748aee2ea9Ben Murdoch#
17231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
29dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block# Request a modern Django
30dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Blockfrom google.appengine.dist import use_library
31dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Blockuse_library('django', '1.1')
32231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
33dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Blockfrom google.appengine.ext import webapp
34dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Blockfrom google.appengine.ext.webapp.util import run_wsgi_app
35231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
36dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Blockfrom handlers import dashboardhandler
37dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Blockfrom handlers import menu
38dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Blockfrom handlers import testfilehandler
39d0825bca7fe65beaee391d30da42e937db621564Steve Block
40dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Blockroutes = [
41dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block    ('/dashboards/delete', dashboardhandler.DeleteDashboardFile),
42dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block    ('/dashboards/update', dashboardhandler.UpdateDashboardFile),
43dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block    ('/dashboards/([^?]+)?', dashboardhandler.GetDashboardFile),
44dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block    ('/testfile/delete', testfilehandler.DeleteFile),
45dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block    ('/testfile/upload', testfilehandler.Upload),
46dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block    ('/testfile/uploadform', testfilehandler.UploadForm),
47dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block    ('/testfile/?', testfilehandler.GetFile),
48dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block    ('/*|/menu', menu.Menu),
49dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block]
50d0825bca7fe65beaee391d30da42e937db621564Steve Block
51dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Blockapplication = webapp.WSGIApplication(routes, debug=True)
52dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block
53dd8bb3de4f353a81954234999f1fea748aee2ea9Ben Murdoch
54dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Blockdef main():
55dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block    run_wsgi_app(application)
56dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block
57dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Blockif __name__ == "__main__":
58dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block    main()
59