~ubuntu-branches/debian/jessie/web2py/jessie

« back to all changes in this revision

Viewing changes to router.example.py

  • Committer: Package Import Robot
  • Author(s): José L. Redrejo Rodríguez
  • Date: 2011-11-04 10:12:01 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20111104101201-ym8q3030ik8sc10u
Tags: 1.99.2.1-1
* Updated upstream sources with real 1.99.2 version
* Ensure python-gtk2 is not needed to run web2py, fixing 
  debian/patches/gtk_gui (Closes: #646931)
* Refreshed debian/patches/avoid_updating patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
#
15
15
#  default_application: default application name
16
16
#  applications: list of all recognized applications, or 'ALL' to use all currently installed applications
17
 
#      Names in applications are always treated as an application names when they appear first in an incoming URL.
18
 
#      Set applications=None to disable the removal of application names from outgoing URLs.
 
17
#       Names in applications are always treated as an application names when they appear first in an incoming URL.
 
18
#       Set applications=None to disable the removal of application names from outgoing URLs.
19
19
#  domains: optional dict mapping domain names to application names
20
 
#      The domain name can include a port number: domain.com:8080
21
 
#      The application name can include a controller:  appx/ctlrx
22
 
#      Example:
23
 
#      domains = {   "domain.com" : "app",
 
20
#       The domain name can include a port number: domain.com:8080
 
21
#       The application name can include a controller:  appx/ctlrx
 
22
#           or a controller and a function: appx/ctlrx/fcnx
 
23
#       Example:
 
24
#       domains = {   "domain.com" : "app",
24
25
#                  "x.domain.com" : "appx",
25
 
#                },
 
26
#                 },
26
27
#  path_prefix: a path fragment that is prefixed to all outgoing URLs and stripped from all incoming URLs
27
28
#
28
29
#  Note: default_application, applications, domains & path_prefix are permitted only in the BASE router,
31
32
#        or in application-specific routers.
32
33
#
33
34
#  default_controller: name of default controller
34
 
#  default_function: name of default function (in all controllers)
 
35
#  default_function: name of default function (in all controllers) or dictionary of default functions
 
36
#       by controller
35
37
#  controllers: list of valid controllers in selected app
36
38
#       or "DEFAULT" to use all controllers in the selected app plus 'static'
37
39
#       or None to disable controller-name removal.
38
40
#      Names in controllers are always treated as controller names when they appear in an incoming URL after
39
 
#      the (optional) application and language names. 
40
 
#  functions: list of valid functions in the default controller (default None)
41
 
#      If present, the default function name will be omitted when the controller is the default controller
42
 
#      and the first arg does not create an ambiguity.
 
41
#      the (optional) application and language names.
 
42
#  functions: list of valid functions in the default controller (default None) or dictionary of valid
 
43
#       functions by controller.
 
44
#       If present, the default function name will be omitted when the controller is the default controller
 
45
#       and the first arg does not create an ambiguity.
43
46
#  languages: list of all supported languages
44
 
#      Names in languages are always treated as language names when they appear in an incoming URL after
45
 
#      the (optional) application name. 
 
47
#       Names in languages are always treated as language names when they appear in an incoming URL after
 
48
#       the (optional) application name.
46
49
#  default_language
47
50
#       The language code (for example: en, it-it) optionally appears in the URL following
48
51
#       the application (which may be omitted). For incoming URLs, the code is copied to
54
57
#       Each default (including domain-mapped) application has its own root-static files.
55
58
#  domain: the domain that maps to this application (alternative to using domains in the BASE router)
56
59
#  exclusive_domain: If True (default is False), an exception is raised if an attempt is made to generate
57
 
#                    an outgoing URL with a different application without providing an explicit host.
58
 
#  map_hyphen: If True (default is False), hyphens in incoming /a/c/f fields are converted 
59
 
#              to underscores, and back to hyphens in outgoing URLs.
60
 
#              Language, args and the query string are not affected.
61
 
#  map_static: By default, the default application is not stripped from static URLs. 
 
60
#       an outgoing URL with a different application without providing an explicit host.
 
61
#  map_hyphen: If True (default is False), hyphens in incoming /a/c/f fields are converted
 
62
#       to underscores, and back to hyphens in outgoing URLs.
 
63
#       Language, args and the query string are not affected.
 
64
#  map_static: By default, the default application is not stripped from static URLs.
62
65
#       Set map_static=True to override this policy.
63
66
#  acfe_match: regex for valid application, controller, function, extension /a/c/f.e
64
67
#  file_match: regex for valid file (used for static file names)
65
68
#  args_match: regex for valid args
66
 
#       This validation provides a measure of security. 
 
69
#       This validation provides a measure of security.
67
70
#       If it is changed, the application perform its own validation.
68
71
#
69
72
#
183
186
    '/fcn#anchor'
184
187
    >>> filter_url('http://domain.com/welcome/default/fcn?query#anchor', out=True)
185
188
    '/fcn?query#anchor'
186
 
    
 
189
 
187
190
    >>> filter_err(200)
188
191
    200
189
192
    >>> filter_err(399)
196
199
if __name__ == '__main__':
197
200
    import doctest
198
201
    doctest.testmod()
 
202