Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>One way is to roll your own, or use django-piston which is excellent. But the problem I have with piston is that is kind a made to be attached to a existing django-project to add an API. It is not so much made for building a resource oriented API with support for formats including HTML.</p> <p>The way I see the use case for Piston is, you have a complete website that serves up html content, but then you would attach an api to that at the url /api/*. Then you go and add Piston to it. With this use case Piston is great, no rewrite needed for existing code and you get whatever you need. It may be that Piston works well without separating the api from the user facing part of the site, but I haven't tried that.</p> <p>It is easier to try to explain this with some examples:</p> <h3>Bitbucket</h3> <ul> <li>User facing url and content: <a href="https://bitbucket.org/jespern" rel="nofollow">https://bitbucket.org/jespern</a></li> <li>Api url and content: <a href="https://api.bitbucket.org/1.0/users/jespern/" rel="nofollow">https://api.bitbucket.org/1.0/users/jespern/</a></li> </ul> <h3>Github</h3> <ul> <li>User facing url and content: <a href="https://github.com/jgorset" rel="nofollow">https://github.com/jgorset</a></li> <li>Api url and content: <a href="https://github.com/jgorset.json" rel="nofollow">https://github.com/jgorset.json</a></li> </ul> <p>Bitbucket is made with Django and django-piston for the API, while Github is made with Ruby On Rails wich has built in support for resources with different formats. I am not saying that you should switch to RoR, because we all love Django, and I am not saying that you couldn't do this with django, but it would be tedious to do this yourself on every view.</p> <p>So a co-worker and I decided that we wanted some of the "magic" of RoR in Django, but we didn't want it to be magical, but make our lives easier without abstracting everything. So <a href="https://github.com/jgorset" rel="nofollow">jgorset</a> wrote <a href="https://github.com/jgorset/django-respite/" rel="nofollow">Respite</a> which is a little Django framework to make "RESTful" APIs in the same fashion as RoR does, but in Django. It is still in early development, but we use it daily in our work projects and it is highly customizable, much like Django itself. It tries to simplify making resource oriented webpages, and structure your code without getting in your way.</p> <p>So naturally my recommendation would be to look at, and try Respite: <a href="https://github.com/jgorset/django-respite/" rel="nofollow">https://github.com/jgorset/django-respite/</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload