{"action":"created","issue":{"url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3882","labels_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3882/labels{/name}","comments_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3882/comments","events_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3882/events","html_url":"https://github.com/tomchristie/django-rest-framework/issues/3882","id":129335849,"number":3882,"title":"Cryptic error message from serializers.py","user":{"login":"flyingcircle","id":5239875,"avatar_url":"https://avatars.githubusercontent.com/u/5239875?v=3","gravatar_id":"","url":"https://api.github.com/users/flyingcircle","html_url":"https://github.com/flyingcircle","followers_url":"https://api.github.com/users/flyingcircle/followers","following_url":"https://api.github.com/users/flyingcircle/following{/other_user}","gists_url":"https://api.github.com/users/flyingcircle/gists{/gist_id}","starred_url":"https://api.github.com/users/flyingcircle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flyingcircle/subscriptions","organizations_url":"https://api.github.com/users/flyingcircle/orgs","repos_url":"https://api.github.com/users/flyingcircle/repos","events_url":"https://api.github.com/users/flyingcircle/events{/privacy}","received_events_url":"https://api.github.com/users/flyingcircle/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-28T04:47:45Z","updated_at":"2016-01-28T09:28:57Z","closed_at":"2016-01-28T09:28:57Z","body":"Alright I've been trying to figure out this issue for some time now, but it is just far too cryptic to me. I tried copying down almost word for word from the setup guide.\r\n\r\nDjango - 1.9.1\r\nrest_framework - 3.3.2\r\npython 2.7.3\r\n\r\nInternal Server Error: /api/v1/tasks/\r\nTraceback (most recent call last):\r\n  File \"/home/sas/sas/lib/python2.7/site-packages/django/core/handlers/base.py\", line 174, in get_response\r\n    response = self.process_exception_by_middleware(e, request)\r\n  File \"/home/sas/sas/lib/python2.7/site-packages/django/core/handlers/base.py\", line 172, in get_response\r\n    response = response.render()\r\n  File \"/home/sas/sas/lib/python2.7/site-packages/django/template/response.py\", line 160, in render\r\n    self.content = self.rendered_content\r\n  File \"/home/sas/sas/lib/python2.7/site-packages/rest_framework/response.py\", line 71, in rendered_content\r\n    ret = renderer.render(self.data, media_type, context)\r\n  File \"/home/sas/sas/lib/python2.7/site-packages/rest_framework/renderers.py\", line 675, in render\r\n    context = self.get_context(data, accepted_media_type, renderer_context)\r\n  File \"/home/sas/sas/lib/python2.7/site-packages/rest_framework/renderers.py\", line 617, in get_context\r\n    raw_data_post_form = self.get_raw_data_form(data, view, 'POST', request)\r\n  File \"/home/sas/sas/lib/python2.7/site-packages/rest_framework/renderers.py\", line 540, in get_raw_data_form\r\n    content = renderer.render(serializer.data, accepted, context)\r\n  File \"/home/sas/sas/lib/python2.7/site-packages/rest_framework/serializers.py\", line 503, in data\r\n    ret = super(Serializer, self).data\r\n  File \"/home/sas/sas/lib/python2.7/site-packages/rest_framework/serializers.py\", line 243, in data\r\n    self._data = self.get_initial()\r\n  File \"/home/sas/sas/lib/python2.7/site-packages/rest_framework/serializers.py\", line 386, in get_initial\r\n    for field in self.fields.values()\r\n  File \"/home/sas/sas/lib/python2.7/site-packages/rest_framework/serializers.py\", line 339, in fields\r\n    for key, value in self.get_fields().items():\r\n  File \"/home/sas/sas/lib/python2.7/site-packages/rest_framework/serializers.py\", line 949, in get_fields\r\n    fields[field_name] = field_class(**field_kwargs)\r\nTypeError: __init__() takes at least 2 arguments (1 given)\r\n\r\n\r\nurls.py:\r\nurlpatterns = [\r\n    url(r'^api/v1/', include(router.urls)),\r\n    url(r'^api/v1/api-auth/', include('rest_framework.urls', namespace='rest_framework')),\r\n    url(r'^admin/', include(admin.site.urls)),\r\n]\r\n\r\n\r\nrouters.py\r\nrouter = routers.DefaultRouter()\r\n\r\nfrom #########.tasks.api import TasksViewSet\r\nrouter.register(r'tasks', TasksViewSet, base_name=\"tasks\")\r\n\r\n\r\ntasks/api.py\r\nfrom rest_framework import serializers\r\nfrom rest_framework import viewsets\r\nfrom rest_framework.response import Response\r\n\r\nfrom .models import Task\r\n\r\n\r\nclass TaskSerializer(serializers.ModelSerializer):\r\n    class Meta:\r\n        model = Task\r\n        fields = (\"id\", \"type\", \"file\", \"###########\", \"###########\",\r\n                  \"priority\", \"submit_time\", \"submitter_email\", \"status\")\r\n\r\n\r\nclass TasksViewSet(viewsets.ModelViewSet):\r\n    \"\"\"\r\n    Viewset to add/view tasks.\r\n    \"\"\"\r\n    queryset = Task.objects.all()\r\n    serializer_class = TaskSerializer\r\n"},"comment":{"url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/comments/176081155","html_url":"https://github.com/tomchristie/django-rest-framework/issues/3882#issuecomment-176081155","issue_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3882","id":176081155,"user":{"login":"xordoquy","id":2340654,"avatar_url":"https://avatars.githubusercontent.com/u/2340654?v=3","gravatar_id":"","url":"https://api.github.com/users/xordoquy","html_url":"https://github.com/xordoquy","followers_url":"https://api.github.com/users/xordoquy/followers","following_url":"https://api.github.com/users/xordoquy/following{/other_user}","gists_url":"https://api.github.com/users/xordoquy/gists{/gist_id}","starred_url":"https://api.github.com/users/xordoquy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xordoquy/subscriptions","organizations_url":"https://api.github.com/users/xordoquy/orgs","repos_url":"https://api.github.com/users/xordoquy/repos","events_url":"https://api.github.com/users/xordoquy/events{/privacy}","received_events_url":"https://api.github.com/users/xordoquy/received_events","type":"User","site_admin":false},"created_at":"2016-01-28T09:28:57Z","updated_at":"2016-01-28T09:28:57Z","body":"Somehow you use a field either defined explicitly on `TaskSerializer` or on the `Task` model that isn't compatible with Django REST framework.\r\nPlease note that the [discussion group](https://groups.google.com/forum/#!forum/django-rest-framework) is the best place to take this discussion and other usage questions. Thanks!"}}