New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not import settings 'graphite.settings' #1153

Closed
ghost opened this Issue Feb 12, 2015 · 2 comments

Comments

Projects
None yet
1 participant
@ghost

ghost commented Feb 12, 2015

I have some problems when I try to install graphite.

I have set up carbon, whisper, ceres and graphite-web. And copy the manage.py to /opt/graphite/webapp/graphite from source package.

But when I excute 'python manage.py syncdb' showed error as below, I'm not sure what caused this. Please help to.

Traceback (most recent call last):
File "manage.py", line 11, in
execute_from_command_line(sys.argv)
File "/usr/lib/python2.6/site-packages/django/core/management/init.py", line 443, in execute_from_command_line
utility.execute()
File "/usr/lib/python2.6/site-packages/django/core/management/init.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python2.6/site-packages/django/core/management/init.py", line 261, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/usr/lib/python2.6/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.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
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 6, in
from django.db import models
File "/usr/lib/python2.6/site-packages/django/db/init.py", line 11, in
if DEFAULT_DB_ALIAS not in settings.DATABASES:
File "/usr/lib/python2.6/site-packages/django/utils/functional.py", line 184, in inner
self._setup()
File "/usr/lib/python2.6/site-packages/django/conf/init.py", line 42, in _setup
self._wrapped = Settings(settings_module)
File "/usr/lib/python2.6/site-packages/django/conf/init.py", line 95, in init
raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'graphite.settings' (Is it on sys.path?): No module named graphite.settings

@brutasse

This comment has been minimized.

Member

brutasse commented Feb 12, 2015

You don't need manage.py. Please try:

PYTHONPATH=/opt/graphite/webapp django-admin.py syncdb

@ghost

This comment has been minimized.

ghost commented Feb 13, 2015

Thanks! It works fine when I try to execute as below:
PYTHONPATH=/opt/graphite/webapp /usr/lib/python2.6/site-packages/django/bin/django-admin.py syncdb --settings=graphite.settings

@brutasse brutasse closed this Feb 13, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment