Tutorial by Examples

Add tastypie to INSTALLED_APPS. Create an api directory in your app with a bare init.py. 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): ...
Tastypie can be installed with python package management, ie, pip or we can directly checkout the code from Github pip install django-tastypie Checkout from Github
There are other API frameworks out there for Django. You need to assess the options available and decide for yourself. That said, here are some common reasons for tastypie. You need an API that is RESTful and uses HTTP well. You want to support deep relations. You DON’T want to have to write yo...
Tastypie is a reusable app (that is, it relies only on its own code and focuses on providing just a REST-style API) and is suitable for providing an API to any application without having to modify the sources of that app. Not everyone’s needs are the same, so Tastypie goes out of its way to provide...
Up to now we tried get request. (If you need to try other HTTP resquest, use some API testing tools like curl or postman) If you try sending a POST/PUT/DELETE to the resource, you find yourself getting “401 Unauthorized” errors. For safety, Tastypie ships with the authorization class set to ReadOnl...

Page 1 of 1