close
Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.
- Timestamp:
-
Jul 9, 2008, 2:47:41 PM (16 years ago)
- Author:
-
cmlenz
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v2
|
v3
|
|
26 | 26 | This application proxy forwards all operations to the actual application class. The application class has a `ctxt` property that provides access to various thread-local objects, such as the current HTTP request. |
27 | 27 | |
| 28 | == Initialization with a Configuration File == |
| 29 | |
| 30 | The `Application` provides a convenience factory function that lets you instantiate an application using an INI-style configuration file. |
| 31 | |
| 32 | For example, assume the following configuration is stored in `conf/myapp.ini`: |
| 33 | |
| 34 | {{{ |
| 35 | #!ini |
| 36 | [app] |
| 37 | locale = en_US |
| 38 | timezone = UTC |
| 39 | doctype = html-strict |
| 40 | debug = true |
| 41 | }}} |
| 42 | |
| 43 | Now you can easily instantiate your application using the `configure()` class method: |
| 44 | |
| 45 | {{{ |
| 46 | #!pycon |
| 47 | >>> from mypkg import MyApp |
| 48 | >>> myapp = MyApp.configure('conf/myapp.ini') |
| 49 | }}} |
| 50 | |
| 51 | See ConfigOptions for information on the configuration options that are available by default, although you can of course always add your own. |
| 52 | |
28 | 53 | == API Documentation == |
29 | 54 | |