Skip to content

Commit

Permalink
Merge branch 'gunicorn-v14-support' of https://github.com/caxap/sentry
Browse files Browse the repository at this point in the history
…into caxap-gunicorn-v14-support

Conflicts:
	setup.py
  • Loading branch information
dcramer committed Jun 9, 2012
2 parents d7ab4fa + 17c77e9 commit 0f395c1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
30 changes: 22 additions & 8 deletions sentry/services/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,30 @@
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from gunicorn.app.djangoapp import DjangoApplication
from gunicorn.arbiter import Arbiter

import sys
import gunicorn

from gunicorn import arbiter
from gunicorn.app import djangoapp

from sentry.services.base import Service


class SentryApplication(DjangoApplication):
if gunicorn.version_info < (0, 14, 0):
def _setup_app(app):
app.validate()
app.activate_translation()
else:
def _setup_app(app):
import gunicorn.util
djangoapp.make_default_env(app.cfg)
djwsgi = gunicorn.util.import_module("gunicorn.app.django_wsgi")
djwsgi.make_wsgi_application()


class SentryApplication(djangoapp.DjangoApplication):

def __init__(self, options):
self.usage = None
self.cfg = None
Expand All @@ -31,11 +47,9 @@ def init(self, parser, opts, args):
pass

def load(self):
# application should be imported at first to setup env
from sentry.wsgi import application

self.validate()
self.activate_translation()

_setup_app(self)
return application


Expand Down Expand Up @@ -73,7 +87,7 @@ def __init__(self, host=None, port=None, debug=False):

def run(self):
try:
Arbiter(self.app).run()
arbiter.Arbiter(self.app).run()
except RuntimeError, e:
sys.stderr.write("\nError: %s\n\n" % e)
sys.stderr.flush()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
'django-paging>=0.2.4',
'django-picklefield>=0.2.0',
'django-templatetag-sugar>=0.1.0',
'gunicorn>=0.13.4,<0.14.0',
'gunicorn>=0.13.4',
'logan>=0.3.1',
'pynliner>=0.4.0',
'python-dateutil>=1.5.0,<2.0.0',
Expand Down

0 comments on commit 0f395c1

Please sign in to comment.