當我試圖按照Django Rest框架的快速入門示例時出現錯誤。至於我可以告訴我已經成立了一切,需要的話,我已經看了它幾次,但似乎無法找到錯誤 的錯誤如下django框架快速入門時出現類型錯誤
Environment:
Request Method: GET
Request URL: http://webdev.lab.unlab.ca/
Django Version: 1.6
Python Version: 2.7.3
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware')
Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
114. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py" in view
69. return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py" in wrapped_view
57. return view_func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py" in dispatch
399. response = self.handle_exception(exc)
File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py" in dispatch
387. self.initial(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py" in initial
317. self.check_permissions(request)
File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py" in check_permissions
273. for permission in self.get_permissions():
File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py" in get_permissions
226. return [permission() for permission in self.permission_classes]
Exception Type: TypeError at/
Exception Value: 'type' object is not iterable
人看到這是怎麼回事?
你要發佈更多的實際代碼的人來幫助你 – Anentropic