6 ms·
Django REST Framework is Django's killer app (as Django is Python's killer app). If you need an API, it's a great batteries-included way to build one.
by wahnfrieden 10y ago
Django REST Framework is Django's killer app (as Django is Python's killer app). If you need an API, it's a great batteries-included way to build one.
- doc_holliday 10y agoHaving been using the Django REST Framework for my latest project, I can too confirm that the REST Framework is Django's killer app. The level of productivity in writing API backend you can get off it is insane.
- dfsegoat 10y agoUsing DRF and company in production 24/7. There are some quirks that I find a bit annoying (nested serializer write behavior) - but other than that it is great.
- 0xCMP 10y agoYep that + all the migration tooling in Django makes getting the API side of a website going very easy.
- vittore 10y agoDid you try Eve(flask based) at all of API ?
- ropable 10y agoWhat, no love for the built-in database migrations? That feature has to be second, at the very least.
- danpalmer 10y agoCould you elaborate a little about DRF? I spent a day or so evaluating it among some other options for an API in a Django project, and it seemed to be a relatively poor player in the Django ecosystem and be quite complex for the same outcome compared to other libraries. It seemed like it would be ok for a DRF specific project, but in as a single part of a larger project it didn't seem to fit well. That said, I have very limited experience with it.
- clintonb 10y ago> ...it seemed to be a relatively poor player in the Django ecosystem... DRF fits in very nicely with Django, especially if you are used to class-based views. We use it at edX for nearly all of our APIs. We don't have many complaints. As someone mentioned regarding Django, it is important to not try to work around the framework. If you're not making a RESTful API, you may have a hard time taking full advantage of DRF.
- danpalmer 10y agoBringing it into a Django project of ~250 apps, I found it didn't play particularly well with app nesting and fitting into a complex URL hierarchy, although part of this could be that we might have been trying to fight it slightly.
- Walkman 10y agoYeah, nesting is a nightmare, but you can define your URL pattern any way you like instead of using the router.
- teilo 10y agoDRF is at its best when you develop an application from the ground up using it. It also "does the right thing," and helps you stay RESTful. In particular, if you use its HyperlinkModelSerializers and its baked ViewSets, it just plain works, no fuss. But it's important to know what these shortcuts are doing so that when you need to write custom APIs that go beyond CRUD, you know what to do. For very simple APIs, DRF is overkill, and if I only need a couple JSON endpoints, I don't bother with it. But if I need full access to my models, you just can't beat it.
- danpalmer 10y agoThanks! Much appreciated.