Skip to content
Browse files

Merge branch 'gunicorn-v14-support' of https://github.com/caxap/sentry

…into caxap-gunicorn-v14-support

Conflicts:
	setup.py
  • Loading branch information...
2 parents d7ab4fa + 17c77e9 commit 0f395c1c63c7389263f8d6efd10e28e63f137d01 @dcramer dcramer committed Jun 9, 2012
Showing with 23 additions and 9 deletions.
  1. +22 −8 sentry/services/http.py
  2. +1 −1 setup.py
View
30 sentry/services/http.py
@@ -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
@@ -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
@@ -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()
View
2 setup.py
@@ -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',

0 comments on commit 0f395c1

Please sign in to comment.
Something went wrong with that request. Please try again.