[Django]-Django error when installing Graphite – settings.DATABASES is improperly configured. Please supply the ENGINE value

14👍

graphite version 0.9.10 supports Django 1.4… however they put the sqlite settings in django’s local_settings.py

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

9👍

You need to edit settings.py and set the contents of the DATABASES variable to something other than empty strings. There are comments next to it that tell you which database engines are supported:

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.
    }
}

If you have nothing else installed, you could append sqlite3 to the ENGINE string which is easy for development on your local machine.

9👍

For users landing here with the error message “The SECRET_KEY setting must not be empty”, make sure to set the secret key in /opt/graphite/webapp/graphite/app_settings.py as well as in your django config.

1👍

I just add the DATABASES dictionary to the end of the file, it works.I hope the the graphite can run based on the Django 1.4.1

👤feng

Leave a comment