NSWI142: Web Applications

Python and HTTP server

Preliminaries

Please read this section at least one day prior to the seminar. This section outlines what you are expected to know, be able to do, or prepare in advance. Following these instructions will help you get the most out of the seminar and ensure smooth participation.

Preliminaries

Before the start of the practical, you should be able to:

  • Explain basics of HTTP.
  • Create a simple calculator in Python.
  • Read from and write to a file using Python.

To use your own computer make sure you have following software installed.

  • Python
  • uv or alternative

Task list

  • Project and package management - uv.
  • Python : file read and write, global state, decorators.
  • Flask.
  • Test using "curl" an a browser.
  • Routing and path arguments, e.g., "<page>.html".
  • HTTP Response : status code, headers, content.
  • Generate HTML response from path argument.
  • Templates, Flask, and Jinja.
  • Serving static content.
  • Visit counter.

Questions, ideas, or any other feedback?


Please feel free to use the anonymous feedback form.