Configuration Options
Various configuration options can be set to influence how various subsystems in the framework go about their work. Setting these options is done by passing them into the Application constructor as keyword arguments, or by setting the values in the app.config dictionary.
Authentication
- auth_secret
- A secret key to be used for the encryption of authentication cookies. Required for cookie-based authentication.
- auth_ticket_ignoreip
- Whether the IP address of the remote user should be ignored. Taking the IP address into account can be problematic for users behind proxies that make their requests appear to be coming from different addresses.
- auth_ticket_timeout
- The time until an authentication cookie expires, in minutes.
- email_from
- The default From address for outgoing emails.
- smtp_server
- The host name of the SMTP server to use for outgoing mail.
- smtp_port
- The port number of the SMTP server (default 25).
- smtp_username
- The username to use for authentication against the SMTP server.
- smtp_password
- The password to use for authentication against the SMTP server.
- smtp_tls
- Whether to use TLS for the SMTP server connection.
Error Handling
- debug
- Whether debugging and developer-oriented error pages should be enabled.
- error_email_to
- The email address(es) to send error notification mails to. Multiple addresses can be specified by separating them with commas.
Forms
- csrf_protection
- Whether forms should automatically be protected against Cross-Site Request Forgery (CSRF) attacks.
General
- mime_types
- Path to a custom MIME type mapping file (such as /etc/mime.types).
Internationalization
- locale
- The default locale to use (for example “de_AT”).
- timezone
- The default timezone to apply for date/time display (for example “Europe/Berlin?”).
Sessions
- session_secret
- A secret key to be used for signing and authenticating session cookies. This needs to be set for applications that use session storage.
- session_cookie_name
- The name of the cookie used to store session state (defauls to “session”)
- session_cookie_path
- The path for the cookie (defaults to “/”)
- session_cookie_domain
- The domain name for the cookie
- session_max_age
- The maximum age of a session in seconds (defaults to 360, which is one hour)
Templating
- doctype
- The default DOCTYPE to use for rendered HTML pages.
- reload_templates
- Whether templates should be automatically reloaded when the underlying file has changed (true or false).
- template_errors
- How lookup errors in Python code in templates should be treated (strict or lenient).
Last modified 15 years ago
Last modified on Nov 6, 2009, 12:15:01 PM