Mount the given root, start the builtin server (and engine), then block. root: an instance of a "controller class" (a collection of page handler methods) which represents the root of the application. script_name: a string containing the "mount point" of the application. This
(root=None, script_name='', config=None)
| 154 | |
| 155 | |
| 156 | def quickstart(root=None, script_name='', config=None): |
| 157 | """Mount the given root, start the builtin server (and engine), then block. |
| 158 | |
| 159 | root: an instance of a "controller class" (a collection of page handler |
| 160 | methods) which represents the root of the application. |
| 161 | script_name: a string containing the "mount point" of the application. |
| 162 | This should start with a slash, and be the path portion of the URL |
| 163 | at which to mount the given root. For example, if root.index() will |
| 164 | handle requests to "http://www.example.com:8080/dept/app1/", then |
| 165 | the script_name argument would be "/dept/app1". |
| 166 | |
| 167 | It MUST NOT end in a slash. If the script_name refers to the root |
| 168 | of the URI, it MUST be an empty string (not "/"). |
| 169 | config: a file or dict containing application config. If this contains |
| 170 | a [global] section, those entries will be used in the global |
| 171 | (site-wide) config. |
| 172 | """ |
| 173 | if config: |
| 174 | _global_conf_alias.update(config) |
| 175 | |
| 176 | tree.mount(root, script_name, config) |
| 177 | |
| 178 | engine.signals.subscribe() |
| 179 | engine.start() |
| 180 | engine.block() |
| 181 | |
| 182 | |
| 183 | class _Serving(_local): |