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

[app:main]
app.title = {{package}}
# Baseurl of the application.
# app.base =

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 = postgresql://@/{{package}}

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

# 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.timeout = 1800
session.secret = %(security.cookie_secret)s
session.secure = %(security.cookie_secure)s
session.httponly = %(security.cookie_httponly)s
session.cookie_expires = %(security.cookie_expires)s
session.cookie_path = %(security.cookie_path)s
#session.cookie_domain = %(security.cookie_domain)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_httponly = true
security.cookie_expires = true
security.cookie_path = /
#security.cookie_domain =
# Set header options.
security.header_secure = true
security.header_clickjacking = true
security.header_csp = true

###
# 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
#url_schema = http
#url_prefix =

###
# 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
