The error is : File “C:\Users\BHARATH\projects\myhellowebapp\hellowebapp\urls.py”, line 7, in
url(r’^$’, views.index, name=‘home’),
AttributeError: module ‘collection.views’ has no attribute ‘index’
This is my code:-
from collection import views
from django.conf.urls import url, patterns, include
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = [
url(r’^$’, views.index, name=‘home’),
url(r’^about/$’,
TemplateView.as_view(template_name=‘about.html’),
name=‘about’),
url(r’^contact/$’,
TemplateView.as_view(template_name=‘contact.html’),
name=‘contact’),
url(r’^things/(?P[-\w]+)/$’, views.thing_detail,
name=‘thing_detail’),
# new line we’re adding!
url(r’^things/(?P[-\w]+)/edit/$’,
views.edit_thing,
name=‘edit_thing’),
url(r’^admin/’, admin.site.urls),
]