Skip to content

Instantly share code, notes, and snippets.

@victorespigares
victorespigares / api.py
Created January 6, 2012 01:04
This snippet shows how to bootstrap your Backbone models with Tastypie. If you're using 'api_name' for the URL of your api, make sure you add it to the Resource meta, otherwise 'resource_uri' will be empty when accessing from the view, but not from api ur
class CourseResource(ModelResource):
class Meta:
queryset = Course.objects.all()
resource_name = 'courses'
# without this resource_uri is empty in the view!
api_name = settings.API_VERSION