1

I am trying to install graphite on my RPi following this tutorial. https://www.digitalocean.com/community/tutorials/how-to-install-and-use-graphite-on-an-ubuntu-14-04-server

I am supposed to sync the database with this command sudo graphite-manage syncdb but I get an error because syncdb has been deprecated.

As "syncdb" is not used anymore, I have found online that what I need is "migrate"

I write this command pi@raspberrypi:~ $ sudo graphite-manage migrate

And I get this return:

  File "/usr/bin/graphite-manage", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 294, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 342, in execute
    self.check()
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 374, in check
    include_deployment_checks=include_deployment_checks,
  File "/usr/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 62, in _run_checks
    issues.extend(super(Command, self)._run_checks(**kwargs))
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 361, in _run_checks
    return checks.run_checks(**kwargs)
  File "/usr/lib/python2.7/dist-packages/django/core/checks/registry.py", line 81, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/usr/lib/python2.7/dist-packages/django/core/checks/urls.py", line 14, in check_url_config
    return check_resolver(resolver)
  File "/usr/lib/python2.7/dist-packages/django/core/checks/urls.py", line 24, in check_resolver
    for pattern in resolver.url_patterns:
  File "/usr/lib/python2.7/dist-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/lib/python2.7/dist-packages/django/urls/resolvers.py", line 315, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/usr/lib/python2.7/dist-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/lib/python2.7/dist-packages/django/urls/resolvers.py", line 308, in urlconf_module
    return import_module(self.urlconf_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/lib/python2.7/dist-packages/graphite/urls.py", line 29, in <module>
    urlpatterns = patterns('',
NameError: name 'patterns' is not defined

For some reason I get the error in the last line, and I don't understand what's wrong.

  • Do you expect that we follow the big tutorial to understand your question? – Ingo Mar 26 at 10:32
  • Hi @Ingo , you can say the same thing in a nicer way :) I have edited my question. Thank you for the heads up. – xoani Mar 26 at 10:47
  • Sorry, I won't be impolite. It's this medium. I'm reading many questions so it may be that some comments become a bit short in the hustle :-) – Ingo Mar 26 at 10:59
1

This looks like the same thing as issue #1816 from graphite-web—your Django version is too new.

My suggestion would be to uninstall the package from apt and follow the official instructions to install with Pip:

In order to install Graphite-Web and Carbon, you must first install some development headers. In Debian-based distributions, this will require apt-get install python-dev libcairo2-dev libffi-dev build-essential, and in Red Hat-based distributions you will run yum install python-devel cairo-devel libffi-devel.

Installing in the Default Location To install Graphite in the default location, /opt/graphite/, simply execute as root:

export PYTHONPATH="/opt/graphite/lib/:/opt/graphite/webapp/" 
pip install --no-binary=:all: https://github.com/graphite-project/whisper/tarball/master 
pip install --no-binary=:all: https://github.com/graphite-project/carbon/tarball/master
pip install --no-binary=:all: https://github.com/graphite-project/graphite-web/tarball/master

If there are still issues after doing this, you'll be able to manually ask for an older version of Django with Pip as described in the issue I linked:

pip uninstall Django
pip install "Django>=1.9,<1.9.99

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.