Routing - Building an API in Python with Flask
Tags: python, webdev, beginners, twitch
Published: 2020-01-22 21:02:50

---
title: Routing - Building an API in Python with Flask
published: true
description: Live stream recap notes from Twitch with Cecil Phillip and Brian Clark on January 22, 2020
tags: python,webdev,beginners,twitch
cover_image: https://user-images.githubusercontent.com/6265396/72930158-54918d80-3d29-11ea-90f7-51afaa712cea.png
canonical_url: https://www.clarkio.com/stream/python/2020-01-22
---

In this session, Cecil, Brian and chat learn about routing with Flask as they build out an API in Python. They started off by getting stuck on an issue with VS Live share but work around it and learn of the different ways to set up routing.

The following are notes and details recapping a past live stream where we live code together. The idea behind these streams is that they provide real-world examples of running into problems and solving them or working towards solving them live. Enjoy this latest one on Python 🙂👍

# Wednesday - January 22, 2019

- [Twitch](https://www.twitch.tv/videos/540148313)
- [YouTube](https://youtu.be/LdJELLfzdP8)

## Things we learned

- What routes are in Flask
- How to add and use route parameters
- How to specify the route parameter types

## Next Steps

- Dive deeper into decorators

## Resources

- [How Netflix Uses Python](https://www.techrepublic.com/article/how-netflix-uses-python-streaming-giant-reveals-its-programming-language-libraries-and-frameworks/)
- [Nina Zakharenko](https://www.twitch.tv/nnjaio)
- [Project Repo](https://github.com/cecilphillip/python-flask-stream)
- [Visual Studio Online Configuration](https://docs.microsoft.com/en-us/visualstudio/online/reference/configuring?WT.mc_id=devto-blog-cxa)
- [VS Code Containers Documentation](https://github.com/microsoft/vscode-dev-containers/?WT.mc_id=devto-blog-cxa)
- [GitHub CLI Tool](https://github.com/github/hub)
- [Flask](https://palletsprojects.com/p/flask/)
- [Python Cheat Sheet](https://www.pythoncheatsheet.org/)
- [Microsoft Developer's Python for Beginners](https://www.youtube.com/watch?v=jFCNu1-Xdsw&list=PLlrxD0HtieHhS8VzuMCfQD4uJ9yne1mE6)

## VS Code Extensions Shown/Used

- [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python&WT.mc_id=devto-blog-cxa)
- [VS Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare-pack&WT.mc_id=devto-blog-cxa)
- [Visual Studio Online VS Code Extension](https://marketplace.visualstudio.com/items?itemName=ms-vsonline.vsonline&WT.mc_id=devto-blog-cxa)

## Clips

Clips are a feature on Twitch that let you cut and capture segments of the live stream in the moment (up to 60 seconds). See [how to use clips on Twitch](https://help.twitch.tv/s/article/how-to-use-clips) for more details. The following are some fun moments captured from this stream:

- [Discussing HTTP Verbs and Headers](https://clips.twitch.tv/GlamorousRoughSandpiperLeeroyJenkins)
- [Routing Parameters in a Python API with Flask](https://clips.twitch.tv/LazyWiseLegOhMyDog)
- [Weird and Frustrating Bug in a VS Live Share Session](https://clips.twitch.tv/BillowingPiliableSlothHotPokket)

## Segments

> Links not working on Twitch? It's most likely because Twitch will only save my stream recordings for about 60 days. Use the YouTube link at the top of this page instead.

This table helps point out different segments of the stream (highlighted in bold) or moments we learned something (not bold). The timestamps link to the video on Twitch at that point in the recording. If you'd like the YouTube link above will have similar timestamps and link to those same points in the recording as well.

| Timestamp                | Topic       |
| ------------------------ | ----------- |
| [00:20:25](https://www.twitch.tv/videos/540148313?t=00h20m25s) | **Quick break** |
| [00:24:42](https://www.twitch.tv/videos/540148313?t=00h24m42s) | **Back from break** |
| [00:37:40](https://www.twitch.tv/videos/540148313?t=00h37m40s) | **Moving on from the issue we were seeing in vs code with live share.** |
| [00:38:12](https://www.twitch.tv/videos/540148313?t=00h38m12s) | **Really looking into routing and decorators now** |
| [01:32:54](https://www.twitch.tv/videos/540148313?t=01h32m54s) | **Recap and raid** |

## YouTube Video

{% youtube LdJELLfzdP8 %}

## Get connected with Cecil Phillip

- [Twitter](https://twitter.com/cecilphillip)
- [Twitch](https://twitch.tv/cecilphillip)
- [Instagram](https://instagram.com/cecilphillip)
- [GitHub](https://github.com/cecilphillip)
- [Website](https://cecilphillip.com/)

## Get connected with Brian Clark

- [Twitter](https://twitter.com/_clarkio)
- [Twitch](https://twitch.tv/clarkio)
- [Instagram](https://instagram.com/_clarkio)
- [YouTube](https://youtube.com/clarkio)
- [GitHub](https://github.com/clarkio)
- [Website](https://www.clarkio.com)

-----

Thanks for reading this article. If you're interested in finding more content from Microsoft Cloud Advocates check out this monthly curated newsletter: [Developer Community Newsletter](https://azure.microsoft.com/en-us/resources/join-the-azure-developer-community/?WT.mc_id=pythonfromscratch-devto-cxa)