Python Backend #1: Flask Web Server Setup (Beginner Python Tutorial)
5.4K views on YouTube
Python Web Backend Series (Part 1/6)
Turn Python into a working web server using Flask β a lightweight and beginner-friendly framework. In this quick-start tutorial, weβll walk through setting up Flask in VS Code, running your server, and returning your first JSON response.
π§ Tools Youβll Need:
Python: https://www.python.org/downloads/
VS Code: https://code.visualstudio.com/
Flask: Install with pip install flask
pip3 install flask
π What Youβll Learn:
β
Creating your first local web server
β
What __name__ == “__main__” means
β
Running your server in VS Code
β
Understanding the localhost:5000 address
π₯ Download My Project Files
π Get the source code here:
π https://ndcswift.github.io/Swift-Projects/
β±οΈ Timestamps:
00:00 β Intro to the series
00:35 β Tools we’re using today
01:08 β Project setup
01:21 β Installing Flask
02:06 β Imports
02:20 β establishing our app
02:40 β Routing our app with a URL path
02:58 β Creating our home function / message
03:49 β Only run this app if weβre running this file directly
04:32 β Running our local server
05:04 β Seeing our server (local host)on a web browser
05:26 β What we’ve built & wrap up