Closed almalki closed 10 years ago
The reverse function hasn't changed in 10 months and I've not seen any other issues raised, so on balance it seems most likely that this is a combination of an error in your URLconf and an unhelpful error message from Django's URL resolver as a result. (The exception is being raised by Django's reverse
function)
I'd suggest narrowing this down by simply calling Django's reverse function instead, since that's where the exception is being raised...
from django.core.urlresolvers import reverse
reverse('print_request_list', kwargs={'format': format})
Don't know if this helps any? http://stackoverflow.com/questions/17610732/error-dictionary-update-sequence-element-0-has-length-1-2-is-required-on-dj
Because the exception is being raised by Django's reverse function I'm going to close this off for now, but I would still be interested in hearing the root cause once you've debugged this. Also, having said that, if you do some more digging and you still think this is a REST framework specific issue feel free to reopen the ticket and add further detail.
The stackoverflow link was really helpful, the problem was a missing "name" for the view name karg in urlconf. It was not the view that reverse was looking for, it was another view. I dont know what I was thinking when I raised this bug report without doing research, it was late night and was frustrated by lack support for different serializers for request and response..(I know it can be done with APIView, but in that case we lose the Browsable API) Sorry for the false alarm and keep up the good work..
no problem, glad it's resolved. :)
I got this exception using DRF reverse, i am not sure if it is something wrong with DRF, Django or my setup. Basically what I am doing is
in my root view for browsable API, where 'print_request_list' is a view: