Python Forum
NameError: name 'patterns' is not defined
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NameError: name 'patterns' is not defined
#1
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.
Reply
#2
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  I'm getting a NameError: ...not defined. vonArre 2 312 Mar-24-2024, 10:25 PM
Last Post: vonArre
  Regex Include and Exclude patterns in Same Expression starzar 2 806 May-23-2023, 09:12 AM
Last Post: Gribouillis
  The included URLconf 'scribimus.urls' does not appear to have any patterns in it. nengkya 0 1,075 Mar-03-2023, 08:29 PM
Last Post: nengkya
  Getting NameError for a function that is defined JonWayn 2 1,122 Dec-11-2022, 01:53 PM
Last Post: JonWayn
  How to remove patterns of characters from text aaander 4 1,124 Nov-19-2022, 03:34 PM
Last Post: snippsat
Question Help with function - encryption - messages - NameError: name 'message' is not defined MrKnd94 4 2,913 Nov-11-2022, 09:03 PM
Last Post: deanhystad
  [split] NameError: name 'csvwriter' is not defined. Did you mean: 'writer'? cathy12 4 3,353 Sep-01-2022, 07:41 PM
Last Post: deanhystad
  NameError: name ‘app_ctrl’ is not defined 3lnyn0 0 1,522 Jul-04-2022, 08:08 PM
Last Post: 3lnyn0
  NameError: name 'hash_value_x_t' is not defined Anldra12 5 1,935 May-13-2022, 03:37 PM
Last Post: deanhystad
  NameError: name 'cross_validation' is not defined tmhsa 6 13,374 Jan-17-2022, 09:53 PM
Last Post: TropicalHeat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020