reverse('rest_framework:logout') raises ValueError: dictionary update sequence element #0 has length 1; 2 is required

227 views
Skip to first unread message

Giovanni Allegri

unread,
Oct 7, 2013, 4:12:25 PM10/7/13
to django-res...@googlegroups.com
Hi,
I'm moving my first steps with Rest Framework.
I've started with a basic setup, mostly using default classes like ModelViewSet and DefaultRouter.
Requesting my model-list from the browser, the api.html template is loaded but when it encounters the {% optional_login request %} template tag I get the following error:

Request Method: GET
Request URL: http://localhost:8000/rest/users/
Django Version: 1.5.4
Exception Type: ValueError
Exception Value:
dictionary update sequence element #0 has length 1; 2 is required
Exception Location: /home/giova/.virtualenvs/django/local/lib/python2.7/site-packages/django/core/urlresolvers.py in _populate, line 279
Python Executable: /home/giova/.virtualenvs/django/bin/python

The exception happens as indicated in urlresolvers.py but I can't figure out what is causing it.

Thanks for your help,
Giovanni

Giovanni Allegri

unread,
Oct 7, 2013, 4:17:38 PM10/7/13
to django-res...@googlegroups.com
I add some informations maybe useful.

I've instantiated my router:

router = DefaultRouter()
router.register(r'users', UserViewSet)

and I've appended the following urls to my URLpatterns:

url(r'^rest/', include(router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),




Reply all
Reply to author
Forward
0 new messages