Implements auto-reload and daemon mode.
Heavily inspired by pyramid pserve, with pieces of code taken from it.
auto-reload
Start the server in a subprocess that auto-stops when a file is modified,
and exit with a specific code.
daemon mode
Uses some code from pserve, but use the cw configuratione so the command
is compatible with 'status' and 'stop' commands.
from logilab.common.configuration import REQUIRED
import cubicweb.schema
cubicweb.schema.INTERNAL_TYPES.add('CWSession')
options = (
('pyramid-auth-secret', {
'type': 'string',
'default': REQUIRED,
'help': 'Secret phrase to encrypt the authentication cookie',
'group': 'pyramid',
'level': 3
}),
('pyramid-session-secret', {
'type': 'string',
'default': REQUIRED,
'help': 'Secret phrase to sign the session cookie',
'group': 'pyramid',
'level': 3
}),
)