Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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()
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()
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()
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')
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()
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()
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()
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()
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()
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