How to use the gunicorn.app.base.Application function in gunicorn

To help you get started, we’ve selected a few gunicorn examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github enigmagroup / enigmabox-openwrt / teletext / files / root / opt / enigmabox / teletext / bottle.py View on Github external
def run(self, handler):
        from gunicorn.app.base import Application

        config = {'bind': "%s:%d" % (self.host, int(self.port))}
        config.update(self.options)

        class GunicornApplication(Application):
            def init(self, parser, opts, args):
                return config

            def load(self):
                return handler

        GunicornApplication().run()
github pebbie / pebahasa / bottle.py View on Github external
def run(self, handler):
        from gunicorn.app.base import Application

        config = {'bind': "%s:%d" % (self.host, int(self.port))}
        config.update(self.options)

        class GunicornApplication(Application):
            def init(self, parser, opts, args):
                return config

            def load(self):
                return handler

        GunicornApplication().run()
github bottlepy / bottle / bottle.py View on Github external
def run(self, handler):
        from gunicorn.app.base import Application

        config = {'bind': "%s:%d" % (self.host, int(self.port))}
        config.update(self.options)

        class GunicornApplication(Application):
            def init(self, parser, opts, args):
                return config

            def load(self):
                return handler

        GunicornApplication().run()
github benoitc / gunicorn / gunicorn / app / djangoapp.py View on Github external
self.cfg.set("pythonpath", pythonpath)

    def load(self):
        # chdir to the configured path before loading,
        # default is the current dir
        os.chdir(self.cfg.chdir)

        # set settings
        make_default_env(self.cfg)

        # load wsgi application and return it.
        mod = util.import_module("gunicorn.app.django_wsgi")
        return mod.make_wsgi_application()


class DjangoApplicationCommand(Application):

    def __init__(self, options, admin_media_path):
        self.usage = None
        self.prog = None
        self.cfg = None
        self.config_file = options.get("config") or ""
        self.options = options
        self.admin_media_path = admin_media_path
        self.callable = None
        self.project_path = None
        self.do_load_config()

    def init(self, *args):
        if 'settings' in self.options:
            self.options['django_settings'] = self.options.pop('settings')
github openedoo / openedoo / openedoo / management / commands / gunicornserver.py View on Github external
def run(self, host, port, workers):
        """Start the Server with Gunicorn"""
        from gunicorn.app.base import Application

        class FlaskApplication(Application):
            def init(self, parser, opts, args):
                return {
                    'bind': '{0}:{1}'.format(host, port),
                    'workers': workers
                }

            def load(self):
                return app

        application = FlaskApplication()
        return application.run()
github Netflix / security_monkey / security_monkey / manage.py View on Github external
def handle(self, app, *args, **kwargs):

        if app.config.get('USE_ROUTE53'):
            route53 = Route53Service()
            route53.register(app.config.get('FQDN'), exclusive=True)

        workers = kwargs['workers']
        address = kwargs['address']

        if not GUNICORN:
            print('GUNICORN not installed. Try `runserver` to use the Flask debug server instead.')
        else:
            class FlaskApplication(Application):
                def init(self, parser, opts, args):
                    return {
                        'bind': address,
                        'workers': workers,
                        'timeout': 1800
                    }

                def load(self):
                    return app

            FlaskApplication().run()
github apache / asterixdb / asterix-examples / src / main / resources / admaql101-demo / bottle.py View on Github external
def run(self, handler):
        from gunicorn.app.base import Application

        config = {'bind': "%s:%d" % (self.host, int(self.port))}
        config.update(self.options)

        class GunicornApplication(Application):
            def init(self, parser, opts, args):
                return config

            def load(self):
                return handler

        GunicornApplication().run()
github gsi-upm / calista-bot / FE-Controller / lib / ext / bottle.py View on Github external
def run(self, handler):
        from gunicorn.app.base import Application

        config = {'bind': "%s:%d" % (self.host, int(self.port))}
        config.update(self.options)

        class GunicornApplication(Application):
            def init(self, parser, opts, args):
                return config

            def load(self):
                return handler

        GunicornApplication().run()
github tellapart / taba / src / taba / third_party / bottle.py View on Github external
def run(self, handler):
        from gunicorn.app.base import Application

        config = {'bind': "%s:%d" % (self.host, int(self.port))}
        config.update(self.options)

        class GunicornApplication(Application):
            def init(self, parser, opts, args):
                return config

            def load(self):
                return handler

        GunicornApplication().run()
github Dallinger / Dallinger / dallinger / experiment_server / gunicorn.py View on Github external
import multiprocessing
import os
from dallinger.config import get_config
import logging

logger = logging.getLogger(__file__)

WORKER_CLASS = "geventwebsocket.gunicorn.workers.GeventWebSocketWorker"


def when_ready(arbiter):
    # Signal to parent process that server has started
    logger.warning("Ready.")


class StandaloneServer(Application):
    loglevels = ["debug", "info", "warning", "error", "critical"]

    def __init__(self):
        """__init__ method
        Load the base config and assign some core attributes.
        """
        self.usage = None
        self.cfg = None
        self.callable = None
        self.prog = None
        self.logger = None

        self.load_user_config()
        self.do_load_config()

    @property