Understanding the config file
Every Jifty Application uses a config file, etc/config.yml to control its operation. In absence of a config file, all values are guessed with reasonable defaults. The config file is in yaml format, which is described on the YAML Homepage.
A sample config file
A typical minimal config file looks like this:
---
framework:
AdminMode: 1
ApplicationClass: DemoApp
ApplicationName: DemoApp
Database:
Database: demoapp
Driver: SQLite
Host: localhost
Password: ''
RecordBaseClass: Jifty::DBI::Record::Cachable
User: ''
Version: 0.0.1
DevelMode: 1
L10N:
PoDir: share/po
LogLevel: INFO
Mailer: Sendmail
MailerArgs: []
Plugins:
- Login: {}
Web:
BaseURL: http://localhost
DataDir: var/mason
Globals: []
MasonConfig:
autoflush: 0
default_escape_flags: h
error_format: text
error_mode: fatal
Port: 8888
ServeStaticFiles: 1
StaticRoot: share/web/static
TemplateRoot: share/web/templates
Accessing config entries
Note that the top level key in this config file is framework. Inside Jifty, you might access any point under this key by simply using Jifty->config->framework->('some_key')->{whatever}.
If you like to define some structure of your own, Jifty reserves the top level keyword application whose entries can get accessed by using Jifty->config->app->('some_key')->{whatever}.
If you intend to edit the config file by hand, be sure that you understand the basics of the YAML format. Please do not change the indentation of lines and ensure your editor will not replace series of spaces by tab characters.
Understanding the entries
The most interesting keys are:
- framework/AdminMode If this switch is set to '1' (or a value that renders to a boolean "true" value to be precise), the administration mode is enabled in the frontend. The default templates will add a red bar displaying a hint and add some administrative entries into the page navigation bar. Internally, the user currently browsing through the website will by default be a superuser if not logged in.