With the growing popularity of Angular.js and similar tools, more applications need to provide a RESTful API. Tastypie is a Python module that does most of the work for us. Let's check it out.
- [Instructor] More and more apps are being built…with the advanced front-end tools,…such as AngularJS, Ember, Backbone, and more.…These tools access data using REST APIs,…usually exchanging data in JSON format.…In this section, we'll discuss how to easily add…a RESTful API to your Django applications.…We'll introduce Tastypie and how…it will expose your models as REST resources.…Then we'll add some additional data…and query options to our API,…and then add authentication, so that we can do create,…read, update, and delete methods on our data.…
First we'll install Tastypie…and then we'll create a basic API.…Let's start with Tastypie.…This is an addon module for Django…that makes it easy to add an API.…It an do a lot, way more than we can cover…in this video series.…But we'll demonstrate the features…you're most likely to need.…Before we can do much, we need to install Tastypie.…I'm using a virtual env., but that's not required.…The steps are the same either way.…Simply use pip to install the module named Django-tastypie.…
Django is one of the world's leading web development platforms. This Python web framework makes your app building experience smoother, faster, and easier. It is a key feature behind the success of many start-ups across the world, including Instagram and Nextdoor. This course introduces next-level advanced concepts to help you build your own professional-grade Django applications.
Author Kevin Veroneau starts off by explaining how class-based views—a powerful, but often poorly understood feature—work in Django. Then learn how to create custom middleware to help organize frequently used code. Have you ever wanted to build a complete RESTful API? Find out how to do just that, starting with a basic read-only API and then adding key-based authentication to allow the full range of CRUD functionality. Plus, discover how to use model managers and the Q method to make it easier to get the data we need to our views and clients.
For the finishing touches, dive into the details of caching to improve application performance, and then add custom management commands to help automate routine tasks.
- Extending class-based views
- Creating custom class-based views
- Managing your database with middleware
- Creating template filters and tags
- Building a RESTful API
- Modeling advanced database relationships and queries
- Using a model manager for your application