当我使用
from django.conf import settings
在我的 DjangoRestFramework 视图中,
class UserList(ListCreateAPIView):
queryset = settings.AUTH_USER_MODEL.objects.all()
serializer_class = UserSerializer
我收到错误
AttributeError at /users/
'str' object has no attribute 'objects'
Request Method: GET
Request URL: http://localhost:9999/users/
Django Version: 1.5.1
Exception Type: AttributeError
Exception Value:
'str' object has no attribute 'objects'