Skip to content

felipap/restful-django-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A RESTful Django

A sample REST application using django and ajax.

Natively, Django makes it hard to implement a REST app. It doesn't even handle data passed to PUT/DELETE requests the same way it does with GET/POST. The projcet is just an example of a specific RESTful interface to be used with django.

I took a django project (a manager to organize lists of words in english), and re-implemented it following REST. The logic is inside app.views, app.doREST and app.helpers. The javascript, 'wordb/static/function.js', is responsible for the interface dynamics (including most of the templating work).

I chose not to use backbonejs or any client-side frameworks like that, but adding should be easy enough. For now, data is stored in the DOM (ugly, right?), using HTML5 datasets.

I've taken a look at other REST wrappers to django (such as django-piston and toastdriven), but they seemed overly-complex for this minimalistic app. I simply re-wrote django's class-based-views with a REST api in mind.

Todo:

  • Implement an object fetcher for subclasses of RESTHandler in app.views.

About

RESTful implementation of a basic create/read/update/delete app.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published