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 6 and Version 7 of ApplicationObject


Ignore:
Timestamp:
Jul 15, 2008, 7:45:54 PM (16 years ago)
Author:
cmlenz
Comment:

Document package data conventions

Legend:

Unmodified
Added
Removed
Modified
  • ApplicationObject

    v6 v7  
    5151See ConfigOptions for information on the configuration options that are available by default, although you can of course always add your own.
    5252
     53== Package Data Conventions ==
     54
     55An application can easily avoid explicit configuration of things like the template and locale directories or URL routing by sticking to a directory layout convention that puts these resources in standard paths inside the application package.
     56
     57The prerequisite for this to work is to specify a class variable called `package` on the `Application` subclass, which must be the package name as string. For example:
     58
     59{{{
     60#!pycon
     61>>> from diva.core import Application
     62>>>
     63>>> class MyApp(Application):
     64...    package = 'mypkg'
     65}}}
     66
     67With that class variable set, templates, PO/MO translation catalogs, and the routing configuration file are expected in the following directories:
     68
     69 * `mypkg/conf/routing.cfg`
     70 * `mypkg/locale` (with subdirectories of the form `[locale]/LC_MESSAGES`)
     71 * `mypkg/templates`
     72
     73Of course these defaults can be overridden by setting the equivalent attributes on the `Application` class, or by specifying them via the constructor.
     74
    5375== Application Context Variables ==
    5476