O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Web Development in Python with Django: Building Backend Web Applications and APIs with Django

Video Description

9+ Hours of Video Instruction

Leverage Python and the Django web framework to develop applications quickly and securely.

Overview

Web Development in Python with Django LiveLessons gets you up and running with the Django framework. You learn how to start Django projects and organize code using Django apps. You structure data and define behavior with Django models. You learn how to generate databases based on Django models, manipulate data in the database with Python, and manage a database with Django migrations. Display the data in your database in HTML using Django URL paths, Django views, and the Django Template Language; or display in JSON using Django Rest Framework’s (DRF) Serializers, Routers, and ViewSets. Securely receive, validate, and manipulate incoming user data in your Django Forms or in your DRF Serializers. You even learn how to run a development server inside of Docker. Finally, you learn how to deploy to the cloud in general and to Heroku specifically.

About the Instructor

Andrew Pinkham is the founder and lead engineer at JamBon Software, which provides development consulting services. He is the author of Django Unleashed (Pearson) and a popular speaker at DjangoCon U.S., and he provides instruction in Python and Django. Andrew specializes in web and mobile products and enjoys communicating complex ideas in simple ways. He is also passionate about usability, security, and distributed systems. He is a 2009 graduate of Dartmouth College and currently resides in Boston, MA.

Skill Level
  • Intermediate
Learn How To
  • Create a Django project with Django apps
  • Structure data in Django models for use in a database
  • Generate and manage a database entirely in Python
  • Display data via an API using Django Rest Framework
  • Display data in HTML Pages using Django
  • Receive and manipulate data via an API created with Django Rest Framework
  • Receive and manipulate data via HTML forms generated by Django
  • Deploy your project to the cloud
Who Should Take This Course
  • Python programmers and other software developers interested in leveraging the Django web framework to build web applications
Course Requirements
  • Python programming experience
Lesson Descriptions

Lesson 1: Revisit Web Development Fundamental Concepts
Lesson 1 covers the fundamentals of web applications. Most software is a solution to a problem, and so you need to understand the problem before you can go about solving the problem. The goal of this lesson is to make sure you understand the problems that web applications solve as well as the problems that web frameworks such as Django help solve. This will help you understand the rest of the lessons and why Django works the way it does.

Lesson 2: Prepare the Project and Manipulate Data
Lesson 2 addresses organizing data and getting data structured. Like building a house, where you begin with a foundation, Django and Python are the foundation for your project. Continuing the analogy, houses may or may not have basements. That should be planned up front, not decided later after the house is well under way. Structuring data models is similar. Not every web application needs data models, but if you are building a web application that needs them, you want to start developing that model from the start. You learn how to structure data in Django so that it generates your database automatically, setting yourself up for success when building out the rest of the application. Also, you learn how to use Docker to run a development server for your application.

Lesson 3: Display Data via an API
In Lesson 3, you can now allow users to view the data in the database. You learn how to build API endpoints using Django Rest Framework APIViews, Serializers, and ModelSerializers, to display your data in JSON or other serialized formats, such as XML or YAML. You further learn to use Django Rest Framework’s generic views, such as the RetrieveAPIView and ListAPIView, to shorten your code.

Lesson 4: Display Data in HTML Pages
In Lesson 4, you learn how to use Django to return HTML to display the data. Learn to use Django’s core triumvirate to generate and return HTML: Django views, URL paths, and the Django Template language. Build your application using both function views and class-based views. Learn to use Django shortcuts to make your life easier, and leverage Django generic class-based views to radically limit the amount of code you write.

Lesson 5: Receive and Manipulate Data via an API
In Lesson 5, you build API endpoints that enable users to modify data on the server by handling the HTTP POST, PUT, PATCH, and DELETE methods by modifying Django Rest Framework APIViews to leverage ModelSerializers. Learn to avoid work and build more quickly by using generic API views such as the CreateAPIView, DestroyAPIView, and even the RetrieveUpdateDestroyAPIView.

Lesson 6: Receive and Manipulate Data via HTML Forms
Lesson 6 uses Django Forms and ModelForms to render HTML forms in the Django Template Language and then enable the processing and validation of data submitted by users through the forms.

Lesson 7: Deploy!
Lesson 7 covers how to deploy your application to the cloud. The lesson discusses the different types of clouds and what works best with different types of applications and different kinds of organizations. It covers modifications to Django for deployments generally and for deployment to Heroku specifically. You also actually deploy the application. Finally, the lesson covers how you might have done things differently in a real application setting, using other tools and working top down rather than bottom up, the approach taken for purposes of the course.

About Pearson Video Training

Pearson publishes expert-led video tutorials covering a wide selection of technology topics designed to teach you the skills you need to succeed. These professional and personal technology videos feature world-leading author instructors published by your trusted technology brands: Addison-Wesley, Cisco Press, Pearson IT Certification, Prentice Hall, Sams, and Que Topics include: IT Certification, Network Security, Cisco Technology, Programming, Web Development, Mobile Development, and more. Learn more about Pearson Video training at http://www.informit.com/video.

Table of Contents

  1. Introduction
    1. Web Development in Python with Django: Introduction 00:03:09
  2. Lesson 1: Revisit Web Development Fundamental Concepts
    1. Learning objectives 00:00:46
    2. 1.1 Communicate with backend servers via the HyperText Transfer Protocol 00:15:51
    3. 1.2 Serialize and structure data in JSON, HTML, XML, and CSS 00:03:51
    4. 1.3 Organize state with databases and caching 00:05:27
    5. 1.4 Follow a development process 00:05:37
    6. 1.5 Compare the Zen of Python and Django to alternatives 00:04:34
    7. 1.6 Prepare your development setup 00:04:33
    8. 1.7 Secure your web applications 00:07:23
  3. Lesson 2: Prepare the Project and Manipulate Data
    1. Learning objectives 00:01:11
    2. 2.1 Define the project specification 00:15:12
    3. 2.2 Start a new Django project and app with Django Rest Framework 00:17:40
    4. 2.3 Structure data with Django models and fields 00:18:11
    5. 2.4 Add behavior with model methods 00:12:33
    6. 2.5 Manipulate data in the database with Python 00:25:31
    7. 2.6 Manage a database with Django 00:18:14
    8. 2.7 Customize the admin interface 00:11:23
    9. 2.8 Run a development server in Docker 00:20:42
  4. Lesson 3: Display Data via an API
    1. Learning objectives 00:00:24
    2. 3.1 Use Django views and URL paths to respond to users 00:10:26
    3. 3.2 Manually serialize Django Model instances to JSON strings 00:18:38
    4. 3.3 Build a serializer to convert Python classes to JSON and XML 00:22:58
    5. 3.4 Integrate serializers with views 00:15:12
    6. 3.5 Improve discoverability and security with HyperlinkedIdentityFields 00:07:11
    7. 3.6 Inherit generic API views to return data from HyperlinkedModelSerializers subclasses 00:14:39
    8. 3.7 Extend generic API view behavior 00:17:50
    9. 3.8 Configure URL paths for future lessons 00:04:36
  5. Lesson 4: Display Data in HTML Pages
    1. Learning objectives 00:00:24
    2. 4.1 Use Django views to build webpages 00:03:52
    3. 4.2 Display data in Django templates 00:17:00
    4. 4.3 Structure templates using template inheritance 00:05:48
    5. 4.4 Manipulate templates in Python with template, context, and loader 00:07:50
    6. 4.5 Build views and URL paths for HTML pages 00:13:53
    7. 4.6 Leverage generic views for startup and blog post web pages 00:05:11
    8. 4.7 Build URIs with Django's reverse function 00:05:26
    9. 4.8 Create links between webpages 00:04:08
    10. 4.9 Plan next steps for templates 00:05:06
  6. Lesson 5: Receive and Manipulate Data via an API
    1. Learning objectives 00:00:31
    2. 5.1 Create tags via HTTP POST methods 00:13:33
    3. 5.2 Update tags via HTTP PUT and PATCH methods 00:15:40
    4. 5.3 Delete tags via HTTP DELETE methods 00:02:27
    5. 5.4 Simplify the API code with viewsets and routers 00:12:16
    6. 5.5 Manipulate Startup objects 00:23:15
    7. 5.6 Manipulate NewsLink objects 00:10:02
  7. Lesson 6: Receive and Manipulate Data via HTML Forms
    1. Learning objectives 00:00:20
    2. 6.1 Build Django forms 00:13:41
    3. 6.2 Understand Django forms as finite state machines 00:07:39
    4. 6.3 Build Django view functions to create, update, and delete tag objects 00:12:39
    5. 6.4 Replace the class-based views with generic class-based views 00:08:58
  8. Lesson 7: Deploy!
    1. Learning objectives 00:00:54
    2. 7.1 Select a Cloud provider 00:09:33
    3. 7.2 Prepare for deployment 00:16:04
    4. 7.3 Deploy to Heroku 00:19:09
    5. 7.4 Start a new project with what you’ve learned 00:08:06
  9. Summary
    1. Web Development in Python with Django: Summary 00:01:05