[Fixed]-TypeError: 'function' object has no attribute '__getitem__' from urls.py

1👍

url patterns are not written like that.

Read more here: https://docs.djangoproject.com/en/1.10/topics/http/urls/

Write it like this: (remove the list of url[..])

urlpatterns = [

    url(r'^$', ListView.as_view(queryset=IOC.objects.all(),template_name="Folder_Name/Folder_Name.html")),

]

0👍

You have unnecessary square brackets around the arguments to url.

Leave a comment