Exemplo n.º 1
0
def setup_loggers(*args, **kwargs):
    """Configure the logger."""
    configure_logger()
Exemplo n.º 2
0
gunicorn -b 127.0.0.1:80 --log-file - --timeout 120 timesketch.wsgi:application

Example configuration for Apache with mod_wsgi (a2enmod mod_wsgi):
<VirtualHost *:443>
        ServerAdmin root@localhost
        SSLEngine On
        SSLCertificateFile    /etc/apache2/cert.crt
        SSLCertificateKeyFile /etc/apache2/cert.key
        WSGIScriptAlias / /path/to/this/file/wsgi.py
</VirtualHost>
"""

# If you installed Timesketch in a virtualenv you need to activate it.
# This needs to be before any imports in order to import from the virtualenv.
#activate_virtualenv = '/path/to/your/virtualenv/bin/activate_this.py'
#execfile(activate_virtualenv, dict(__file__=activate_virtualenv))

from timesketch.app import configure_logger
from timesketch.app import create_app
from timesketch.models import db_session

configure_logger()
application = create_app()


# pylint: disable=unused-argument
@application.teardown_appcontext
def shutdown_session(exception=None):
    """Remove the database session after every request or app shutdown."""
    db_session.remove()