New Graphite Installation, empty SECRET_KEY - can't configure

Asked by Steve Keller

Just installed Graphite on a new system, used pip to install Django. The current Django version is 1.5.

When I try to set up the web app, running manage.py fails:

python manage.py syncdb
/usr/lib/python2.6/site-packages/django/core/management/__init__.py:465: DeprecationWarning: The 'execute_manager' function is deprecated, you likely need to update your 'manage.py'; please see the Django 1.4 release notes (https://docs.djangoproject.com/en/dev/releases/1.4/).
  DeprecationWarning)
/usr/lib/python2.6/site-packages/django/core/management/__init__.py:409: DeprecationWarning: The 'setup_environ' function is deprecated, you likely need to update your 'manage.py'; please see the Django 1.4 release notes (https://docs.djangoproject.com/en/dev/releases/1.4/).
  DeprecationWarning)
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 469, in execute_manager
    utility.execute()
  File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 272, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 77, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/usr/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/usr/lib/python2.6/site-packages/django/core/management/commands/syncdb.py", line 8, in <module>
    from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal
  File "/usr/lib/python2.6/site-packages/django/core/management/sql.py", line 9, in <module>
    from django.db import models
  File "/usr/lib/python2.6/site-packages/django/db/__init__.py", line 11, in <module>
    if settings.DATABASES and DEFAULT_DB_ALIAS not in settings.DATABASES:
  File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 52, in __getattr__
    self._setup(name)
  File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 47, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 150, in __init__
    raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.

This is on a RHEL 6 64 bit system, Python 2.6.6.

What is wrong?

Thanks!

Question information

Language:
English Edit question
Status:
Solved
For:
Graphite Edit question
Assignee:
No assignee Edit question
Solved by:
Steve Keller
Solved:
Last query:
Last reply:
Revision history for this message
David Lutz (dlutzy) said :
#1

I had to use an older version.

pip install Django==1.4

I didn't dig any deeper into what was wrong though.

Revision history for this message
Steve Keller (skeller-ea) said :
#2

Thanks. I tried:

pip uninstall Django

then

pip install Django==1.4

but it still installed Django 1.5. At least pip told me that it installed 1.5 instead.

So I downloaded Django 1.3.7 from the web site djangoproject.com (I'm not sure about 1.4.5 because of previous issue with 1.4), and ran setup.py manually. Now it works.

Revision history for this message
Arvind Jayaprakash (anomalizer) said :
#3

Try adding this as the last line to your local_settings.py (after the from graphite.app_settings import * directive)
SECRET_KEY = '6=d&__s53kge((0u^oi2!c#n2t8p2!+o@8ou=83spdo=11m-0k'

You can use the django secret key generator to pick your own key: http://www.miniwebtool.com/django-secret-key-generator/

I am running graphite on django 1.5.1 and this works

Revision history for this message
Arvind Jayaprakash (anomalizer) said :
#4

And yes, the _from graphite.app_settings import *_ line needs to be uncommented as well