Legos for your Django API
Failed to load latest commit information.
api_boilerplate Patch session request with CSRF token May 24, 2013
docs Docs folder Mar 30, 2013
example Comments Mar 31, 2013
.gitignore Hide docs folder for now Apr 1, 2013
AUTHORS Initial commit. Mar 30, 2013
LICENSE Initial commit. Mar 31, 2013 Added note about /api/ Apr 1, 2013 May 8, 2013


This project is meant to provide the basics for people to create well behaving APIs for Django projects. It's not an app for automatically creating APIs like tastypie or piston. Instead it provides the building blocks which you can use to roll out your own RESTful API fast with Django's Class based views. This provides:

  • Class based API views and decorators
  • API Responses for different HTTP codes
  • Model pagination
  • Authentication middlewares:
    • Django cookies
    • HTTP Basic
    • API Key

Most of this code is extracted from Kippt's API (documentation on Github). It's designed to be as easy as possible to consume, mainly meaning simple authentication (browser session) and JSON output. This makes API debugging extremely easy with Chrome's JSONView and Postman extensions. You should also be using requests.

Some of the code in this project is influenced by or forked from awesome django-tastypie. HTTP responses are created based on work of Leah Culver and Eric Florenzano.



Default: api_boilerplate.models.ApiKey


Default: 20


Default: False


Default: False


Default: True

Common best practices

  • Use api() method for resource Models to return a Python object. Responses will convert that into JSON. This will make caching easier as well.


  • Docs all the things
  • Better name
  • Test all the things
  • Separation for /api/ url (usually the redirect for docs)
  • JSONP and errors
    • Better way of handling error messages
    • Have a separate field for error messages in JSONP response
  • Rate limiting (Cache/Redis based)