Getting Help

There are two primary ways of getting help. We have a mailing list hosted at Google (http://groups.google.com/group/django-tastypie/) and an IRC channel (#tastypie on irc.freenode.net) to get help, want to bounce idea or generally shoot the breeze.

Quick Start

  1. Add tastypie to INSTALLED_APPS.

  2. Create an api directory in your app with a bare __init__.py.

  3. Create an <my_app>/api/resources.py file and place the following in it:

    from tastypie.resources import ModelResource
    from my_app.models import MyModel
    
    
    class MyModelResource(ModelResource):
        class Meta:
            queryset = MyModel.objects.all()
            allowed_methods = ['get']
    
  4. In your root URLconf, add the following code (around where the admin code might be):

    from tastypie.api import API
    from my_app.api.resources import MyModelResource
    
    v1_api = Api(api_name='v1')
    v1_api.register(MyModelResource())
    
    urlpatterns = patterns('',
      # ...more URLconf bits here...
      # Then add:
      (r'^api/', include(v1_api.urls)),
    )
    
  5. Hit http://localhost:8000/api/v1/?format=json in your browser!

Requirements

Tastypie requires the following modules. If you use Pip, you can install the necessary bits via the included requirements.txt:

If you choose to use Python 2.4, be warned that you will also need to grab the following modules:

Project Versions

Table Of Contents

Previous topic

Table Of Contents

Next topic

Getting Started with Tastypie

This Page