14 Completing a real project

 

This chapter covers

  • Setting up virtual environments
  • Building data models
  • Working with a local database
  • Building a web app

Chapters 2-12 focused on individual techniques, with considerable cross-referencing of pertinent techniques. When I introduced built-in data types (chapters 2-5), for example, we created functions to perform some repeated work. When I discussed functions (chapters 6 and 7) and classes (chapters 8 and 9), we used built-in data types. From examples in the context of the task management app, you’ve seen that these techniques depend on one another to solve realistic problems. Solving these isolated problems is fun in the sense of learning pertinent techniques. The ultimate purpose of learning these individual techniques, however, is to use them collectively to complete a real project from beginning to end.

In this chapter, we’re going to complete the task management app project (section 1.4.3) from the beginning, creating a virtual environment (section 14.1), defining the proper data models (section 14.2), using the backend database (section 14.3), implementing the frontend app (section 14.4), and publishing our package for distribution (appendix E online). As an important note, although we’re going to learn a few new techniques, such as using a local database, we’ll focus on synthesizing the techniques that we learned in chapters 2-12.

14.1 How do I use a virtual environment for my project?

14.1.1 Understanding the rationale for virtual environments

14.1.2 Creating a virtual environment for each project

14.1.3 Installing packages in the virtual environment

14.1.4 Using virtual environments in Visual Studio Code

14.1.5 Discussion

14.1.6 Challenge

14.2 How do I build the data models for my project?

14.2.1 Identifying the business needs

14.2.2 Creating helper classes and functions

14.2.3 Creating the Task class to address these needs

14.2.4 Discussion

14.2.5 Challenge

14.3 How do I use SQLite as my application’s database?

14.3.1 Creating the database