###
# app configuration
# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html
###

[app:main]
app.title = {{package}}

use = egg:{{package}}

pyramid.reload_templates = true
pyramid.debug_authorization = false
pyramid.debug_notfound = false
pyramid.debug_routematch = false
pyramid.default_locale_name = en
pyramid.includes =
    pyramid_tm
    pyramid_mailer
    pyramid_debugtoolbar

# By default, the toolbar only appears for clients from IP addresses
# '127.0.0.1' and '::1'.
# debugtoolbar.hosts = 127.0.0.1 ::1

sqlalchemy.url = sqlite:///%(here)s/{{package}}.sqlite

# mako template settings
mako.directories =
    {{package}}:templates
    ringo:templates

# beaker session settings
session.type = file
session.data_dir = %(here)s/data/sessions/data
session.lock_dir = %(here)s/data/sessions/lock
session.key = customerskey
session.secret = %(security.cookie_secret)s
session.secure = %(security.cookie_secure)s
session.cookie_path = %(security.cookie_path)s
session.httponly = %(security.cookie_httponly)s

###
# Settings for the auth system
###
auth.timeout = 1800
auth.register_user = false
auth.password_reminder = false

###
# Settings for the security system.
###
# Disable the check of the csrf token for testing purpose. The setting
# defaults to enabled checks
security.enable_csrf_check = true
# Set timeout in seconds for the http client caching. A value of 0 means no #
# caching at all. Defaults to 0 seconds.
security.page_http_cache = 0
security.static_http_cache = 3600
# Set cookie options.
security.cookie_secret = secret
security.cookie_secure = false
security.cookie_ip = true
security.cookie_path = /
security.cookie_httponly = true
# Set header options.
security.header_secure = true
security.header_clickjacking = true
security.header_csp = false

###
# Mailserver settings
###
mail.host =
mail.default_sender =
#mail.username =
#mail.password =

###
# wsgi server configuration
###

[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543

###
# logging configuration
# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html
###

[loggers]
keys = root, {{package}}, sqlalchemy

[handlers]
keys = console, filelog

[formatters]
keys = generic

[logger_root]
level = INFO
handlers = console

[logger_{{package}}]
level = DEBUG
handlers =
qualname = {{package}}

[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine
# "level = INFO" logs SQL queries.
# "level = DEBUG" logs SQL queries and results.
# "level = WARN" logs neither.  (Recommended for production systems.)

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[handler_filelog]
class = FileHandler
args = ('%(here)s/{{package}}.log','a')
level = NOTSET
formatter = generic

[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
