2012-11-12 96 views
0

我想記錄我的測試服務器上的Django應用程序發生了什麼,所以我安裝了Django Sentry。Django Sentry安裝步驟錯誤

我所做的一切,因爲它是從官方文檔快速入門指南中,但是當我嘗試初始化出現此錯誤的Web服務:

sentry.conf.py start 
Performing upgrade before service startup... 
Syncing... 
Creating tables ... 
Installing custom SQL ... 
Installing indexes ... 
Installed 0 object(s) from 0 fixture(s) 
Migrating... 
Running migrations for djcelery: 
- Nothing to migrate. 
- Loading initial data for djcelery. 
Installed 0 object(s) from 0 fixture(s) 
Running migrations for django: 
- Nothing to migrate. 
- Loading initial data for django. 
Installed 0 object(s) from 0 fixture(s) 
Running migrations for django: 
- Nothing to migrate. 
- Loading initial data for django. 
Installed 0 object(s) from 0 fixture(s) 
Running migrations for sentry: 
- Nothing to migrate. 
- Loading initial data for sentry. 
Installed 0 object(s) from 0 fixture(s) 

Synced: 
> django.contrib.auth 
> django.contrib.admin 
> django.contrib.contenttypes 
> django.contrib.sessions 
> django.contrib.sites 
> django.contrib.messages 
> crispy_forms 
> sentry.plugins.sentry_mail 
> sentry.plugins.sentry_servers 
> sentry.plugins.sentry_urls 
> sentry.plugins.sentry_user_emails 
> sentry.plugins.sentry_useragents 
> social_auth 
> south 

Migrated: 
- djcelery 
- kombu.transport.django 
- raven.contrib.django 
- sentry 
Running service: 'http' 
Traceback (most recent call last): 
    File "/usr/bin/sentry", line 8, in <module> 
    load_entry_point('sentry==5.0.21', 'console_scripts', 'sentry')() 
    File "/usr/lib/python2.5/site-packages/sentry/utils/runner.py", line 150, in main 
    initializer=initialize_app, 
    File "/usr/lib/python2.5/site-packages/logan/runner.py", line 136, in run_app 
    management.execute_from_command_line([runner_name, command] + command_args) 
    File "/usr/lib/python2.5/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line 
    utility.execute() 
    File "/usr/lib/python2.5/site-packages/django/core/management/__init__.py", line 382, in execute 
    self.fetch_command(subcommand).run_from_argv(self.argv) 
    File "/usr/lib/python2.5/site-packages/django/core/management/base.py", line 196, in run_from_argv 
    self.execute(*args, **options.__dict__) 
    File "/usr/lib/python2.5/site-packages/django/core/management/base.py", line 232, in execute 
    output = self.handle(*args, **options) 
    File "/usr/lib/python2.5/site-packages/sentry/management/commands/start.py", line 78, in handle 
    service.run() 
    File "/usr/lib/python2.5/site-packages/sentry/services/http.py", line 46, in run 
    call_command('run_gunicorn', **self.options) 
    File "/usr/lib/python2.5/site-packages/django/core/management/__init__.py", line 134, in call_command 
    klass = load_command_class(app_name, name) 
    File "/usr/lib/python2.5/site-packages/django/core/management/__init__.py", line 69, in load_command_class 
    module = import_module('%s.management.commands.%s' % (app_name, name)) 
    File "/usr/lib/python2.5/site-packages/django/utils/importlib.py", line 35, in import_module 
    __import__(name) 
    File "/usr/lib/python2.5/site-packages/gunicorn/management/commands/run_gunicorn.py", line 10, in <module> 
    from gunicorn.app.djangoapp import DjangoApplicationCommand 
    File "/usr/lib/python2.5/site-packages/gunicorn/app/djangoapp.py", line 9, in <module> 
    from gunicorn.app.base import Application 
    File "/usr/lib/python2.5/site-packages/gunicorn/app/base.py", line 15, in <module> 
    from gunicorn.config import Config 
    File "/usr/lib/python2.5/site-packages/gunicorn/config.py", line 241 
    except ImportError as e: 
         ^
SyntaxError: invalid syntax 

感謝您的幫助!

回答

1

gunicorn需要Python 2.6 - 其中添加了except T as e語法(請參閱http://www.python.org/dev/peps/pep-3110/)。你至少需要切換到Python 2.6。

請注意,在有些地方gunicorn的文檔說它支持Python 2.5,但那是no longer true

+0

感謝您的回答!切換到較新版本的Python不是一種選擇,因爲有很多應用程序正在運行(不是我的,所以不想破壞它們)。 – dark4p