[Django]-Django REST browser interface

8👍

This may seem obvious, but:
Why not just use Django’s testing client (django.test.client.Client)? then instead of manually ‘debugging’ in your browser, you can write unit tests with expectations and get leverage out of those further down the track.

e.g.

from django.test.client import Client
client = Client()
resp = client.put('/employee/2/', data={'email': 'here@there.com'}, follow=True)
#... etc
👤jsw

3👍

As the author of django-rest-framework it’d be great to pick your brains about which bits of functionality could do with fleshing out. 🙂 (obv i’ve got some thoughts of my own and areas I’m planning to work on, but be really good to get some user perspective)

Your absolutely right about the API browser not being limited to any particular framework. To me that’s the big deal with DRF and I’d love to see more API frameworks take a similar approach. One of the supposed benefits of RESTful APIs is that they should be self-describing, and it seems counter-intuitive to me that so many of the Web APIs we build today are not Web browseable.

Oh, and totally agree with jsw re. testing Web APIs in django, I wouldn’t use the framework’s browsable API to replace automated tests.

0👍

I had the same problem and that was eaily solved by logging out of admin page in that project.

Leave a comment