Chapter 5: Advanced topics

Web frameworks

face Josiah Wang

If you are interested in the server side of things like building your own Web API, then you will likely be using a Web framework library. For example, I used Flask to implement my example blog API that you have been using.

The “big 3” Web frameworks at this time are:

  • Django: Has everything included
  • Flask: More lightweight - you extend with other components when needed
  • FastAPI: Focusses on high performance on the API side

Here is how they compare in terms of popularity (as of January 2024):

We will not be covering Web frameworks in our course (since this will end up being more about learning how to use a library than programming!)

But in case you are interested or find them useful in the future, I have included two talks here from one of our second year undergraduate courses to develop human-centric web applications. One is on Django, another on Flask (FastAPI was still very new at the time). Watch them at a later time when you need them; these will be available as long as you still have your Imperial College account.

Both videos are restricted to students officially registered for the Python Programming course. If you are reading this before starting the degree, I’m afraid you’ll have to wait until you are registered as a student to be able to watch these. Sorry!

The first video is a talk on Django, a Python Web application framework for you to easily build web applications. This video was from 2019.

The second video is a talk on Flask, a Python “web microframework” which is more lightweight than Django. This video is by our very own web development guru Ivan Procaccini from the EdTech team. This video was from May 2020 (from the early lockdown era). The Gitlab repository for the talk can be found here.

Enjoy! Remember that you can come back and watch them later when you need them!