Python Forum

Full Version: NameError: name 'patterns' is not defined
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello guys,

I'm trying to install graphite with Grafana Documentation but when i try to do the following command i get the error:
  

 django-admin.py migrate --pythonpath /opt/graphite/webapp --settings graphite.settings
File "/opt/graphite/webapp/graphite/urls.py", line 29, in <module>
    urlpatterns = patterns('',
NameError: name 'patterns' is not defined
I tried to modify the the line in /opt/graphite/webapp/graphite/urls.py:
 from django.conf.url.defaults import *

to
from django.conf.urls import *
or to
from django.conf.url.defaults import  url, include, patterns 
But still not working, any ideas please.

Thanks.
What was the error from from django.conf.urls import *?
I looked it up, and it looks like django.conf.url.defaults was deprecated four years ago, and removed completely afterward. Which means Grafana (or at least the web interface, since it looks like it has a lot of different parts) was written using a very old version of django... I'm not sure where to go from here, as I would have assumed it would have the right version info for the dependency when you installed via apt.