當我嘗試(manage.py遷移)遷移在Django,我得到以下錯誤:類型錯誤:「功能」對象沒有從屬性「__getitem__」 urls.py
File "C:\Program Files\Python27\Scripts\Folder_Name\Folder_Name\urls.py", line 22, in <module>
url[(r'^$',ListView.as_view(queryset=ABC.objects.all(),template_name="Folder_Name/Folder_Name.html"))],
TypeError: 'function' object has no attribute '__getitem__'
下面是我有for Folder_Name/urls.py
from django.conf.urls import url, include
from django.views.generic import ListView, DetailView
from Folder_Name.models import ABC
urlpatterns = [
url[(r'^$', ListView.as_view(queryset=IOC.objects.all(),template_name="Folder_Name/Folder_Name.html"))],
]
任何幫助將不勝感激。謝謝。
我做了改變,它的工作!我還會閱讀你提供的文檔。謝謝! – LazyPanda