PNL Learn

Python for the Web

How web backends work, from HTTP requests to database queries.

Most Python developer jobs ask for a web framework, REST APIs and SQL. This course is the bridge to all three. You will learn how HTTP requests, methods, status codes, headers and URLs really work, trace a request through DNS, TCP and TLS underneath, call APIs with requests and treat their responses as untrusted input, build a small router with validation and correct status codes, write SQL queries and translate them into Python, and use databases from Python safely with parameterized queries. It ends with a complete in-memory notes API backed by a repository class and graded by a full test suite.

IntermediatePython7 lessons84 exercisesAbout 6 h
Create a free account

What you will learn

  • HTTP
  • DNS, TCP and TLS
  • REST APIs
  • requests
  • Flask and FastAPI
  • SQL
  • SQL injection

Lessons

  1. 1

    How HTTP Works

    Requests and responses, methods, status codes, headers as the content contract, URLs and REST resource names.

    13 exercises

  2. 2

    Under HTTP: DNS, TCP, Ports and TLS

    Trace a URL to a response through DNS, a TCP connection and the TLS handshake; classify addresses, fill in default ports, check a certificate and choose a bind address.

    12 exercises

  3. 3

    Calling APIs with requests

    Call real APIs the way working code does: params, JSON, status checks, timeouts, auth headers, retries, and validating what a partner sends back.

    12 exercises

  4. 4

    Building an API

    What Flask and FastAPI do for you, then build the same machinery yourself: routing, path parameters, validation and status codes.

    11 exercises

  5. 5

    SQL Fundamentals

    Tables and keys, SELECT with WHERE and ORDER BY, NULL, INSERT, UPDATE and DELETE, JOIN and GROUP BY, each one mirrored in Python.

    14 exercises

  6. 6

    Python and Databases

    The DB-API shape, SQL injection and parameterized queries, allowlists for column names, transactions, ORMs, N+1 and migrations.

    12 exercises

  7. 7

    Putting It Together

    Design a complete notes API: a repository, validated handlers with correct status codes, a router with filtering and paging, and a SQL-backed repository.

    10 exercises

How you practice

You practice in the browser and every exercise gives you feedback right away. This course uses these formats:

  • Code exercise: 30
  • Fix the bug: 13
  • Type the answer: 10
  • Predict the output: 9
  • Fill in the blank: 7
  • Match the pairs: 5
  • Select all that apply: 4
  • Multiple choice: 4
  • Reorder lines: 1
  • Spot the bug: 1

Aligned to

CS2023ACM / IEEE-CS / AAAISource
  • Data Management
    • DM-QueryingQuery Construction
  • Security
    • SEC-CodingSecure Coding
  • Networking and Communication
    • NC-FundamentalsFundamentals
    • NC-ApplicationsNetworked Applications
    • NC-SecurityNetwork Security

Proto Node Labs is not affiliated with or endorsed by ACM / IEEE-CS / AAAI. Exam names are trademarks of their owners.