Skip to Content
Visual Studio Code for Python Programmers
book

Visual Studio Code for Python Programmers

by April Speight
July 2021
Intermediate to advanced
256 pages
6h 26m
English
Wiley
Content preview from Visual Studio Code for Python Programmers

CHAPTER 10Create and Debug a Flask App

Flask is a lightweight Web Server Gateway Interface (WSGI) web application framework. Often referred to as a microframework, Flask is designed to keep the core of the application simple and scalable. Though Flask offers suggestions, the framework does not enforce any dependencies or project layouts. Instead, developers have the ability to add new functionality to their app with extensions provided by the community.

In this project, you learn how to create a Flask app and debug it in Visual Studio Code. Sample code is provided in the Flask-app-complete folder to help expediate the app creation. For a detailed review of how to create and manage a Flask app, visit flask.palletsprojects.com.

Getting Started

The project example in this chapter uses the Flask framework to create a web application that generates Lorem ipsum (see Figure 10.1). Lorem ipsum is a Latin-character placeholder text often used to demonstrate document or user-interface layout without relying on meaningful content. The generator takes two input values:

  • Length of Lorem ipsum to generate
  • Format of generated Lorem ipsum (i.e., word or paragraph)

Thus, entering 3 and word generates three words.

Snapshot of the Lorem ipsum app created in this project

Figure 10.1: The Lorem ipsum app created in this project

The files within the Flask-app-complete folder are necessary for completing the exercises in this project and are used ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Clean Code in Python - Second Edition

Clean Code in Python - Second Edition

Mariano Anaya
Visual Studio Code

Visual Studio Code

Bruce Johnson
Python for Programmers

Python for Programmers

Paul Deitel, Harvey Deitel

Publisher Resources

ISBN: 9781119773368Purchase Link