Working :
urlpatterns = patterns('',
(r'^$', views.index),
(r'^test/$|test/(\d+)/$', views.test_page),
(r'^(name)/$', views.index),
(r'^(username)/$', views.index),
)
Not working :
urlpatterns = patterns('views',
(r'^$', index),
(r'^test/$|test/(\d+)/$', test_page),
(r'^(name)/$', index),
(r'^(username)/$', index),
)
Error :
Django Version: 1.3
Exception Type: NameError
Exception Value: name 'index' is not defined
Exception Location: /home/nolhian/Documents/Test/../test/urls.py in <module>, line 8
I followed the docs to do this, where did I go wrong ?
If you use the prefix, you must specify your views as strings: