Django RESTful API - django-piston vs. django-tastypie

后端 未结 4 1257
梦毁少年i
梦毁少年i 2021-01-30 04:45

We\'re looking for a general RESTful API solution for our Django project. We would use the API at first for Ajax calls on the web site and later for mobile apps, external apps a

4条回答
  •  忘了有多久
    2021-01-30 04:52

    Django REST framework 2.0 was anounced in Oct 2012 and now supports OAuth out of the box. What I really like is the Web browseable API, which is really helpful when developing your API, but also when someone implements your API. It's kind of comparable with using the Django admin site for inspecting your models' structure and data, but then for your API. Also the documentation is very good.

    From their website:

    Django REST framework is a powerful and flexible toolkit that makes it easy to build Web APIs.

    Some reasons you might want to use REST framework:

    • The Web browseable API is a huge usability win for your developers.
    • Authentication policies including OAuth1a and OAuth2 out of the box.
    • Serialization that supports both ORM and non-ORM data sources.
    • Customizable all the way down - just use regular function-based views if you don't need the more powerful features.
    • Extensive documentation, and great community support.

    Check out their Quickstart guide to get a quick idea of how it works.

提交回复
热议问题