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.

Changes between Version 2 and Version 3 of ApplicationObject


Ignore:
Timestamp:
Jul 9, 2008, 2:47:41 PM (13 years ago)
Author:
cmlenz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ApplicationObject

    v2 v3  
    2626This 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.
    2727
     28== Initialization with a Configuration File ==
     29
     30The `Application` provides a convenience factory function that lets you instantiate an application using an INI-style configuration file.
     31
     32For example, assume the following configuration is stored in `conf/myapp.ini`:
     33
     34{{{
     35#!ini
     36[app]
     37locale = en_US
     38timezone = UTC
     39doctype = html-strict
     40debug = true
     41}}}
     42
     43Now 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
     51See ConfigOptions for information on the configuration options that are available by default, although you can of course always add your own.
     52
    2853== API Documentation ==
    2954