Questions tagged [tastypie]

Tastypie is a reusable Django App and is suitable for providing an API to any application without having to modify the sources of that app.

Tastypie is a reusable Django App and is suitable for providing a REST API to any application without having to modify the sources of that app.

1634 questions
19
votes
5 answers

Tastypie Negation Filter

Is there a negation filter available by default. The idea is that you can do the following in the django ORM: model.objects.filter(field!=value) How can I do that in tastypie if that is even possible. I…
miki725
  • 24,027
  • 15
  • 91
  • 113
19
votes
2 answers

Making Twitter, Tastypie, Django, XAuth and iOS work to Build Django-based Access Permissions

I will build an iOS application whose functionality will be based on access permissions provided by a Django REST application. Django manages the permissions for the activities in the iOS app. User A can do Work A if he/she is permitted. Permissions…
yretuta
  • 7,614
  • 16
  • 71
  • 143
19
votes
2 answers

retrieving the 'many' end of a Generic Foreign Key relationship in Django

In Django, when I request a resource that has a many-to-many relationship, I end up getting all the items in child part of the relationship, even those not directly related to the parent. It'll be easier if I show you with code (classes trimmed…
George Stocker
  • 55,025
  • 29
  • 167
  • 231
18
votes
3 answers

How to create or register User using django-tastypie API programmatically?

My code below kinda works, it creates the User object and saves but it doesn't save the password: class CreateUserResource(ModelResource): class Meta: allowed_methods = ['post'] object_class = User authentication =…
Elvin R.
  • 842
  • 8
  • 18
18
votes
4 answers

Django Activity Feed (Feedly Integration?)

I have built a simple Django photo app. Users can upload photos, follow other users and like photos. To handle relationships amongst the users (following & unfollowing) I use a package called django-relationships by coleifer. It's a great package…
deadlock
  • 6,181
  • 11
  • 58
  • 105
18
votes
3 answers

iOS app with Django

So we currently have a website that was created using Django. Now, we would like to create a native iOS app that uses the same backend, so we don't have to re-code the whole thing. From my understanding, there are two alternative routes: 1) Call…
abisson
  • 3,975
  • 9
  • 42
  • 66
18
votes
1 answer

Django-tastypie: Any example on file upload in POST?

Could anyone give a complete example on using the tastypie FileField, both server-side and client-side please? Here's what I have tried: #models.py class Foo(models.Model): img = models.ImageField(upload_to="images", null=True, blank=True) …
blurrcat
  • 1,190
  • 14
  • 23
17
votes
1 answer

Token key authentication in Postman

How do I make the below token based authentication call in Postman? curl -H "Authorization: ApiKey dan:ab104c54c6d06fa5bc17e38059c1b814ee9c3b43" -F "image=/path_to_photo/image.jpg" http://localhost:8000/api/photo/ -v This does not work: This is…
dan-klasson
  • 12,215
  • 11
  • 49
  • 91
16
votes
2 answers

Django & TastyPie: request.POST is empty

I'm trying to do a POST using curl: curl --dump-header - -H "Content-Type: application/json" -X POST --data '{"item_id": "1"}' http://www.mylocal.com:8000/api/1/bookmarks/ However, request.POST is always empty. Below is my ModelResource code: class…
dannyroa
  • 5,113
  • 6
  • 37
  • 57
16
votes
1 answer

How to create new resource with foreign key in TastyPie

I'm still new to tastypie, but it seems like a really neat library. Unfortunately, I'm having some difficulties with it. I have two models, and two resources associated with those models: class Container(models.Model): pass class…
NT3RP
  • 14,302
  • 9
  • 56
  • 96
15
votes
2 answers

Unit tests fail after a Django upgrade

I am trying to bring a Django project from version 1.8 to 1.11. Pretty much everything seems to work fine except unit tests. We have a base test class inheriting from Django TestCase with a Tastypie mixin. The base class has some code in the setUp()…
Mad Wombat
  • 12,616
  • 9
  • 58
  • 93
15
votes
2 answers

DataTables: Custom Response Handling

I started working on AngularJS and DataTables and wonder whether it is possible to customize the response DataTables is expecting. The current expectation of the DataTables plugin is something like this: { "draw": 1, "recordsTotal": 57, …
Ankit Popli
  • 2,711
  • 3
  • 36
  • 58
15
votes
5 answers

Tastypie filtering with multiple values

I had a simple question on filtering in tastypie. I want to filter with multiple values. For example: /api/v1/message/?accountId=1,5,12 This doesnt work. Any idea how i can do this? Do i need to use advanced filtering? If yes, how do I go about…
nknj
  • 2,196
  • 3
  • 28
  • 45
14
votes
3 answers

Using non-AMD compatible javascript module with require.js?

I'm using require.js to help organize my Backbone.js based application. I'm trying to figure out the right way to use a 3rd party javascript library that is not AMD compatible with require.js The library in questions is backbone-tastypie.js. …
erikcw
  • 9,517
  • 13
  • 54
  • 72
14
votes
1 answer

Django Tastypie: How to Authenticate with API Key

I'm making an internal API with TastyPie. I have from tastypie.authentication import ApiKeyAuthentication class MyResource(ModelResource): Meta: authentication = ApiKeyAuthentication() With Auth rules disabled, my API works great. With it on,…
Jason Goldstein
  • 1,079
  • 2
  • 11
  • 20