
This video gives an overview of this section.
In this video, we look at a demo of the final product after the three sections, including a templated Django response and browsing a Django REST Framework API.
Look at HTML response
Look at REST API server
In this video, we will install Python, Django and the Django REST Framework onto our development computer
Install Python 3 based on the Operating System of our computer. Create a Virual Environment
Use Pip to install Django and the Django REST framework
Use pip requirements.txt to identify installed python components in a development environment
In this video, we will install PostgreSQL, create a new database and configure Python support
Install PostgreSQL into our development environment
Use Psql to check our installation and create a new database
Use pip to install PostgreSQL support into Python
In this video, we will create a new Django project and then create an application within that project.
Create a project directory and use django-admin startproject
Use manage.py startapp to create a Django application
Review Django external application publishing guidelines
In this video, we will use the development environment we have setup in previous videos to show the Django initial success web page.
Introduce settings.py and configuring our database
Highlight the DEBUG flag and placing sensitive information in settings.py
Use Django’s development webserver via the manage.py runserver command and seeing the Django initial default page
This video gives an overview of MVC and MVT Framework.
Look at the concept of MVC and MVT Framework.
Look at Django models
Look at Django template
In this video, we will discuss Django models, create our first model, create methods on our models and test them.
Introduce Django model and how relationships between Models can be used.
Create a Django model
Create methods on Django models and test them
In this video, we will apply migrations to our Django models, which keep our database structure up to date. We will perform queries on our database.
Consider what Django migrations are and have Django create schema migrations
Consider what data migrations are and create one, and then apply all migrations created so far in this video
Perform some simple queries against our database
In this video, we will create a simple “Hello World” view, consider Django class based views, perform URL configuration and add a parameter to our view.
Discuss Django class based views and use view to create a simple view that returns a hard coded response
Perform URL configuration or routing at both the Project and App level to make our new view accessible. Access the view in a browser
Make use of URL querystring and kwarg parameters. Discuss the pros and cons of each approach
In this video, we will discuss how Django handles requests, Django’s URL routing, matching URLs with path and re_path and HTTP methods.
Discuss how Django handles requests from the request in to middleware, then URL config, then view and then the reverse for the response
Review URL configuration from previous video and discuss use of path() and re_path()
Cover methods (verbs) of Http Requests including Get and Post requests. How Http methods then translate to class methods
In this video, we will cover Django Templates and the TemplateView. We will cover Django’s template inheritance system, how to pass data to templates, where to place template files and template tags and filters.
Explain how hardcoded responses are undesirable. Introduce Django’s TemplateView
Learn about using base templates and view specific templates that extend base templates. Learn how to make data available within templates.
Review template settings in settings.py and see our first set of templates in action
Explain how templates should not perform core logic, however we can use template tags and filters to perform presentation logic
In this video we will consider why we should test, the core tools Django provides for testing, how to configure PostgreSQL for testing and some integration and unit tests.
Learn how we need to use automated testing tools and how we can write test cases that place our code under test
Make use of pqsl to configure PostgreSQL for testing
Develop Integration tests that make use of the Django test client.
Develop unit tests that test specific view functions using a RequestFactory as well as class attributes
This video gives an overview of the entire section and then considers what is an API, what is REST, REST resources, methods and CRUD operations and HTTP Status codes.
Explain the difference between traditional web responses and API responses. Learn how REST provides an API on HTTP
Learn what Resources, HTTP Methods and CRUD operations are
Explain how a result of an API request is communicated via a status code
In this video, we will create an API end point by configuring a URL endpoint for a view that generates JSON output. We will also accept input and perform simple validation.
Make use of a URL pattern configuration to give access to our API view
Define a View using the base View class that uses JsonResponse to return an API response
Include in our View definition validation of a name parameter and return an error if this is equal to fred. Show results in a browser
In this video, we will discuss why we use the DRF, what key parts of the DRF are, who uses it and the web browsable API feature of the DRF.
Learn how the DRF helps us in providing code that we would otherwise have to provide ourselves many times over
Learn what the key parts of the DRF are, including serializers, DRF views, routers and authentication and permissioning. Learn how these relate to CRUD operations
Explore who uses the DRF and see the web browsable feature of the DRF
In this video, we will learn about DRF serializers. We will first look at manually defining a serializer and then use ModelSerializer to base a definition on an existing model.
Review our existing models with focus on the Bookmark Model, then we will define a serializer with create and update methods
Using the Python console, we will create some initial data in the database and then demonstrate what our serializers do with this data along with simulated received data
We will define a serializer based on Bookmark using a ModelSerializer.
We will then demonstrate how this serializer can be used with a list of Bookmarks in the Python console
In this video, we will combine our learnings from the previous two videos with DRF views by building a Bookmarks list and a Bookmarks detail view.
Learn about basic DRF view URL configuration, including format suffixes.
Define a Bookmark List view that can build a list and create new Bookmarks
Learn about basic DRF detail view URL configuration. Define a Bookmark detail view that can get detail, update a Bookmark and delete a Bookmark
Watch a demonstration of all of the functionality previously developed in this video, including listing existing Bookmarks, creating new Bookmarks, updating existing Bookmarks and deleting them.
In this video, we will replace our views from the previous video by exploiting pre-built functionality of the DRF for common CRUD operations.
Make use of ListCreate-APIView for Bookmark listing and new Bookmark creation
Make use of RetriveUpdate-APIView for Bookmark detail queries, updating a Bookmark and deleting a Bookmark
Take advantage of the ModelViewset that combines all the functionality seen earlier in this video in one convenient package.
In this video we will use DRF routers to clean up our URL configuration and create a specialised API action.
Learn about Hyperlinked-Model-Serializers and how they can create related links in our API. Significantly simplify our URL configuration with a DRF router
Create a specialised viewset action that can add a like to a Bookmark. Learn how to define this in the viewset and ensure the DRF router is aware of it. See how it is accessed from the browser
Consider each of the view strategies covered in this and previous videos and scenarios where each would be the best fit
In this video we will consider how we can use DRF automated testing tools to perform integration and unit tests of our API.
Learn how to write an integration test of a DRF based viewset and place different actions under test
Learn how to write a unit test of specific methods of a DRF based viewset, how to isolate dependencies via patching and using mocks to test each operation of the code
See how the Django test runner is used in combination with DRF test tools
This video gives an overview of this section.
In this video we look at a demo of the final product after the three sections, being a React application that consumes APIs from a Django REST server
Walkthrough the application
In this video, we will learn how front end frameworks fit within the MVC concept, how Single-Page Apps work and compare frameworks.
Learn how Front end frameworks cover significant parts of MVC and can run on the browser but also the server.
Learn how Single-Page Apps use state to determine what is displayed at a point in time.
Compare Angular, Vue and React frontend frameworks.
In this video, we will be introduced to Node.js, install Node Version manager and then install Node.
Learn how Node provides a runtime environment as well as a development environment.
Install NVM on our development computer.
Use NVM to select the latest Node LTS version and install it.
In this video, we will setup React with create-react-app and install other project dependencies.
Install create-react-app. Then use it to commence a new React App.
Install various Node dependencies which will be used by our project.
Configure our Django DRF server to support CORS and OAuth2.
In this video, we will create our first Component, use JSX, style and layout our components with CSS and consider reusability.
Build your first Component. Render it using JSX.
Style your Components using CSS.
Consider reusability and use CSS to layout your Components.
In this video we learn how Components receive properties, maintain state, use callbacks, interact with users and fetch data from external APIs.
Render child Components and pass them data. Learn how Components may have internal state which no other Component may change.
Develop callback methods on a Component and pass access to them as properties to other Components.
Receive data through user interactions and by fetching from third-party APIs.
In this video we will learn what React Routing is, use it to create virtual “pages” and use Routing Links.
Learn what React routing is.
Use React Browser-Router to display different Components based on the URL path.
Use Links in the render of our Component to allow the user to move between parts of our App.
In this video we will learn what React automated testing is, test simple components, test state, simulate API calls, and spy on event handlers.
Learn what automated testing is and how to perform this using Node and React.
Test “shallow rendering” of our components and test the output compared to Snapshots.
Test complex Component state, interactions between Components and fake external API calls. Spy on our event handler methods.
This video will teach you how to configure your Django server and React app for OAuth2, and then make a request for an OAuth2 token.
Configure Django URLs for OAuth2 support. Perform related database migrations and register an OAuth2 app.
Configure your React app to make a request for an OAuth2 token.
See how the token is used in all subsequent REST resource consumption in your React App.
In this video, we will develop our React App to cause Read Operations, both list and detail. We will then cause Create Operations to create new Bookmarks on the server.
Make HTTP GET request for a Read Operation on a list and rendering these results to the user
Making HTTP GET requests for a Read Operation for object detail, which includes related lists. Rendering these results to the user and responding to further user interactions.
Developing our App to allow users to specify details for a new object, then making a HTTP POST request for a Create operation to create it.
In this video, we will develop our App to report state through the URL path, respond to user entered path changes or saved browser bookmarks and use the URL QueryString
Cause the browser URL path to be changed based on state changes in our App.
Route the URL path based on user entered or saved browser bookmarks to the relevant parts of our App.
Use the URL QueryString to store state and respond to user directed requests.
In this video we will extend our App to support Update Operations. We will support user editing of our server Bookmarks and related Notes.
Develop a React front end editor and populate it with existing Bookmark data.
Using user entered data, making a HTTP PUT request to cause server Update operations on Bookmarks.
Extend our App to allow Create, Read and Update Operations on Notes related to Bookmarks.
In this video, we will extend our app to support Delete Operations. We will implement this firstly on server Bookmarks and Notes, and then extend to related Comments.
Implement HTTP DELETE requests on user-specified server Bookmarks and Notes and then reflect the related database changes to the user.
Implement the full range of CRUD operation support on Comments related to Bookmarks.
In this video, we will learn what custom REST operations are and consume our server’s custom operation to add likes to both Bookmarks and Comments.
Review CRUD operations and learn how custom operations fit within this framework. Learn what DRF URL paths for these custom operations are.
Develop our App to make custom operations (add likes) on Bookmarks.
Develop our App to make custom operations (add likes) on Comments.
In this video consider how React Routing can work on production servers, how to optimize our app, Django deployment and the Heroku platform as a service.
Learn how our production App may not be based at root (/) and how to configure our App for this.
Learn about options for React App deployment.
Consider issues on how to deploy Django in production. Learn what the production “stack” looks like. Learn about the Heroku service.
One of the best things about Python is that it fits well into any web developer skill set. With the help of Django, Python’s high-end web framework, you can rapidly develop your own websites and build web APIs that are clean and easy to maintain, all while allowing you to integrate your Python code with powerful JavaScript frameworks. If you are a web developer who wants to build full-stack Python apps by creating APIs in Django and then integrating it with React, a frontend JavaScript framework, then go for this course.
This comprehensive 2-in-1 course is a step-by-step tutorial which is a perfect course to create and learn the use of Django REST APIs to make fully-functioning Python applications. You will first set up the development environment for your application. You will then build the backend of your application by creating RESTful APIs in Django. Next, you will learn to build and use React components for designing the UI of your application, and work with React code’s data and state to determine the behavior of it. Finally, you will learn to integrate your Django RESTful APIs with the React frontend to build a complete bookmarking application.
Contents and Overview
This training program includes 2 complete courses, carefully chosen to give you the most comprehensive training possible.
In the first course, Building REST APIs with Python, you will delve into key aspects such as code reusability, deployment, and maintaining your application. You will learn production server configuration and bundle technologies with Python along with React to provide an end-to-end web development solution. You will learn to create REST APIs in Django.
In the second course, Consuming Python APIs with React, you will start by quickly setting up your JavaScript tools and Node.js, as well as React.js for building a bookmarking application project. You will then put together your basic frontend code for interacting with your Django backend. You will also learn to build and use React components for your application's UI, and work with your React code's data and state to determine how your application behaves. Next, you will explore routing and event handling for your application. You will delve into backend interaction details, such as authentication for login. Finally, you will learn to consume your Django resources and also create, update, and delete item data. Alongwith, you will also learn specific tasks such as managing your bookmarks and counting and collecting likes and comments on your bookmarks.
By the end of this course, you will be able to build your RESTful APIs using Django and integrate it into your projects with ease.
About the Authors :
Wayne Merry:
CPA Work Experience:
- Financial Controller HOPE worldwide Australia (Development and benevolence charity) 2013-2017 and consultant to HOPE worldwide Papua New Guinea
- Investment manager Mimas Lapetus Trust 2005-2012
- General Manager Merry's Specialties 2003-2004
- Trading Systems project lead Bourse Data 1998-2003
- Industrial Systems manager United Weighing Australia 1995-1998
Education:
- BA App Sci (Computer Technology) 1991-1994
- Masters of Entrepreneurship and Innovation (Hnrs) 2004-2008
- Masters of Professional Accounting and Masters of International Finance (2010-2012)
Interests:
- Bush Search and Rescue 2009 (developed GPS field training software using Django—first used 2011, and still in use)
- Third-world charity program implementation, reporting, and management
- He works too hard to listen to much music, but he loves listening to techno while programming in Django!