forked from OpenTreeOfLife/opentree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SITE.routes.py
58 lines (49 loc) · 1.85 KB
/
SITE.routes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# -*- coding: utf-8 -*-
# adapted from router.example.py
# NOTE that a bare-bones parametric router is required here, since we've switched
# to parametric routing for opentree and the two can't be mixed. The change
# was required to support hyphens in proper URLs!
#
# All the important stuff is in the app's router (opentree/webapp/routes.py).
# This is just enough to trigger parametric (vs. pattern-based) routing
# throughout the site.
routers = dict(
# base router
BASE=dict(
default_application='opentree',
root_static=[
# look for these files in the default app's static/ directory
'favicon.ico',
'robots.txt',
],
),
# for more routing rules, see routes.py (if any) inside each app's directory
)
# error pages (for ALL APPS)
routes_onerror=[
# ('init/400', '/opentree/default/login'),
# ('curator/*', '/opentree/static/fail.html'),
# ('*/404', '/opentree/static/cantfind.html'),
# ('opentree/*', '/opentree/static/fail.html'),
('curator/404', '/curator/default/error'), # let other codes "flow through" as ugly-but-accurate responses
# this catch-all captures errors in 'curator', so we need to spell out all apps below :-/
# ('*/*', '/opentree/default/error'),
('opentree/*', '/opentree/default/error'),
# this obfuscates error messages from the API
# ('api/*', '/opentree/default/error'),
('admin/*', '/opentree/default/error'),
]
# Specify log level for rewrite's debug logging
# Possible values: debug, info, warning, error, critical (loglevels),
# off, print (print uses print statement rather than logging)
# GAE users may want to use 'off' to suppress routine logging.
#
logging = 'off'
def __routes_doctest():
'''
see router.example.py for example doctests
'''
pass
if __name__ == '__main__':
import doctest
doctest.testmod()