2012-03-24 20 views
20

GRAPHITE'ı ubuntu'ya yüklemeye çalışıyorum. Blogdaki talimatları takip ediyorum.Django hatası hatalı yapılandırılmış. Lütfen MOTOR değerini sağlayın

http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/ 

Komutu çalıştırdığım kısma geldiğimde .. Aşağıdaki hatayı alıyorum. Nasıl çözeceğime dair ipucum var. Django 1.4'in en son sürümünü kullanıyorum. /opt/graphite/webapp/graphite/settings.py dosyasında

cd /opt/graphite/webapp/graphite/ 
sudo python manage.py syncdb 


sudo python manage.py syncdb 
/opt/graphite/webapp/graphite/thirdparty/pytz/__init__.py:32: UserWarning: Module pytz was already imported from /opt/graphite/webapp/graphite/thirdparty/pytz/__init__.pyc, but /usr/local/lib/python2.7/dist-packages/pytz-2012b-py2.7.egg is being added to sys.path 
    from pkg_resources import resource_stream 
Traceback (most recent call last): 
    File "manage.py", line 11, in <module> 
    execute_manager(settings) 
    File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 459, in execute_manager 
    utility.execute() 
    File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 382, in execute 
    self.fetch_command(subcommand).run_from_argv(self.argv) 
    File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 196, in run_from_argv 
    self.execute(*args, **options.__dict__) 
    File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 232, in execute 
    output = self.handle(*args, **options) 
    File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 371, in handle 
    return self.handle_noargs(**options) 
    File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/syncdb.py", line 57, in handle_noargs 
    cursor = connection.cursor() 
    File "/usr/local/lib/python2.7/dist-packages/django/db/backends/dummy/base.py", line 15, in complain 
    raise ImproperlyConfigured("settings.DATABASES is improperly configured. " 
django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details. 

, bu içeriği olduğunu.

#Database settings, sqlite is intended for single-server setups 
DATABASE_ENGINE = 'sqlite3'      # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'. 
DATABASE_NAME = STORAGE_DIR + 'graphite.db'  # Or path to database file if using sqlite3. 
DATABASE_USER = ''        # Not used with sqlite3. 
DATABASE_PASSWORD = ''       # Not used with sqlite3. 
DATABASE_HOST = ''        # Set to empty string for localhost. Not used with sqlite3. 
DATABASE_PORT = ''        # Set to empty string for default. Not used with sqlite3. 

DASHBOARD_CONF = join(CONF_DIR, 'dashboard.conf') 
GRAPHTEMPLATES_CONF = join(CONF_DIR, 'graphTemplates.conf') 

cevap

9

Sen settings.py düzenlemek ve boş dizeleri dışında bir DATABASES değişkenin içeriğini ayarlamak gerekir. Başka yüklü bir şey varsa, yerel makinenizde gelişimi için kolaydır ENGINE dizeye sqlite3 eklemek olabilir

DATABASES = { 
    'default': { 
     'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 
     'NAME': '',      # Or path to database file if using sqlite3. 
     'USER': '',      # Not used with sqlite3. 
     'PASSWORD': '',     # Not used with sqlite3. 
     'HOST': '',      # Set to empty string for localhost. Not used with sqlite3. 
     'PORT': '',      # Set to empty string for default. Not used with sqlite3. 
    } 
} 

: veritabanı motorları desteklenmektedir söylemek onun yanında yorumlar var.

+0

Merhaba, benim düzenlemeye bakın. Oluşturulan ayar dosyası budur. – Tampa

+0

Django'nun hangi sürümünü kullanıyorsunuz? Django'nuzun "DATABASES" değişkenini (veritabanı ayarlarını yapılandırmanın yeni yolu) aradığı göründüğünde, ayar dosyanızın içinde birden fazla "DATABASE_" değişken var (bunu yapmanın eski yolu). –

+0

Ben – Tampa

1

Sadece dosyanın sonuna DATABASES sözlüğü ekleyin, neden grafit Django 1.4.1

14

graphite version 0.9.10 supports Django 1.4 dayalı olarak çalışır umut works.I ... Ancak onlar Django yıllarda sqlite ayarları koymak hata mesajı "secret_key ayarı boş olmamalıdır", yanı sıra /opt/graphite/webapp/graphite/app_settings.py gizli anahtarı ayarlamak emin olun burada iniş kullanıcılar için local_settings.py

[[email protected] graphite]$ cat local_settings.py|grep -v \# 
DATABASES = { 
    'default': { 
     'NAME': '/opt/graphite/storage/graphite.db', 
     'ENGINE': 'django.db.backends.sqlite3', 
     'USER': '', 
     'PASSWORD': '', 
     'HOST': '', 
     'PORT': '' 
    } 
} 
[[email protected] graphite]$ 
[[email protected] graphite]$ pwd 
/opt/graphite/webapp/graphite 
[[email protected] graphite]$ 
9

django yapılandırmanız.

İlgili konular