Live data from Hacker News

Django REST framework 3.5

django-rest-framework.org

61–68 of 68 posts

Re: Django REST framework 3.5

#61
post #5

One metric that I'll measure a framework by is the likelihood of finding an answer to a query that is not articulated in the concepts and terms used by the framework. This is especially useful when starting out. DRF scores well here. It's designed in an intuitive way. The healthy community around it is a big plus as well. Can't count the number of times I've come across a SO article that had updated answers for the l…

> One metric that I'll measure a framework by is the likelihood of finding an answer to a query that is not articulated in the concepts and terms used by the framework. It's also important to measure the likelihood to have to find an answer in the first place. There are vibrant communities around many frameworks, but it doesn't make them all good. Speaking as someone who went from DRF -> Rails -> back to DRF, I can s…

Pyramid maybe? (http://www.pylonsproject.org/)

Re: Django REST framework 3.5

#62

I use Django + DRF along with Ember, and love the combination. All the new schema generation functionality is interesting. It's probably just a matter of time before someone builds a tool that reads the schema generated by Django, and syncs the Ember models with it. That's currently one of the drawbacks of using separate frameworks (and languages) for the client and server.

I'm using that stack for two fairly large projects and loving it... I use the ember-django-adapter to translate data on the client side (previously had used drf json-api).. so far it's not too much hassle to build the ember models as needed but I see what you're saying..

Why did you switch away from DRF JSON API? We used it for one project, then realized how much of a hassle it was to get nested representations of data (last time I checked, it didn't just work out of the box). But going back and changing to Ember Django Adapter is a lot of work, since we have some custom AJAX calls.

For a new project where we were starting from scratch, we stuck with Ember Django Adapter.

Re: Django REST framework 3.5

#64
post #44

Earlier quoted context omitted.

Falcon maybe?

Some more options: Eve: https://github.com/nicolaiarocci/eve Hug: https://github.com/timothycrosley/hug flask-restful: https://github.com/flask-restful/flask-restful

Other than requiring MongoDB, I really liked Eves approach.

Re: Django REST framework 3.5

#65

When I started flirting with Ruby and Rails for building a web app backed by a JSON API, DRF is what convinced me to stick with Django. It has a ridiculous amount of built-in functionality, but without making it hard to customize your API. If you haven't used DRF, you really owe it to yourself to give it a try. I can't wait to see support for real-time views. Is that in the cards for DRF 3.6?

drf and ruby on rails are apples to oranges. you should probably compare django and rails. drf is usually compared to sinatra.

If you're looking at Django alone, Rails has more functionality for building APIs. DRF is the package that makes Django on par with (in my opinion, better than) Rails.

I see Sinatra as more similar to Flask than DRF.

Re: Django REST framework 3.5

#66
post #57
post #54

Anyone been using the new(ish) schema generation features? Sounds useful to be able to generate client libraries from the API spec (e.g. DRF => swagger => JS library), but I haven't felt compelled to do so. Any other use-cases that are paying dividends?

I was thinking about using it to auto-generate documentation, but I found writing some ad-hoc tooling turned out to be more straightforward and flexible.

Yeah, I've been using django-rest-swagger for docs, which has sufficed. Newer versions of that package use the schema-gen stuff from DRF.

(A slight annoyance I've found here: the CoreAPI schema spec doesn't seem to have a place to attach a top-level summary of the API, which is useful as a 'man page' for the rest of the API calls. Swagger does allow for that.)

Re: Django REST framework 3.5

#67
post #41

Earlier quoted context omitted.

Your comment is being downvoted because DRF clearly does a whole lot more than just serialising the response dictionary or adding pagination, you should really have a look at the documentation. However, I still think that Django should have something like the "JSONResponse mixin example"[1] built-in by default; sometimes you are building a product which is not an API but you still need the occasional RESTful endpoint…

You could always import DRF's serializers and parsers/generators without committing to the entire framework. Django does plan on bringing DRF's content negotiation into the main framework: https://www.djangoproject.com/weblog/2015/dec/11/django-awar...

Thanks, that would be a reasonably light-weight alternative.
Post reply on HN