Twitter apps and localhost

If you have tried creating a Twitter app with localhost as the callback URL, you might have received an URL invalid error message. All you have to do is use instead. Simple, isn’t it?

Using angular.js with Tastypie for Django

The following angular.js service will allow you to consume a standard TastyPie REST API. As you may know, TastyPie returns its JSON objects a bit differently from what angular expects, so this service fixes it. This example assumes that you have always_return_data=True in your resource. This is the resource I used with this example: class […]

Tastypie: only allow a user to use its own resources

If you want to limit user access to the resources they own in Tastypie, define obj_create and apply_authorization_limits as such. This will automatically assign created items to the current user, and only return resources that belong to the current user. from tastypie.resources import ModelResource from notes.models import Note class NoteResource(ModelResource): class Meta: queryset = Note.objects.all() […]