{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "ecc15054",
   "metadata": {},
   "source": [
    "# 22-19 · WSGI czy ASGI?\n",
    "\n",
    "Praktyka do sekcji [„WSGI i ASGI: relacji między aplikacją webową a serwerem”"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1b085b4c",
   "metadata": {},
   "source": [
    "## Cel\n",
    "\n",
    "Przypisanie frameworka lub serwera aplikacji do WSGI lub ASGI z tabeli porównawczej na stronie."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d6419b95",
   "metadata": {},
   "source": [
    "## Sprawa robocza"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "851905be",
   "metadata": {},
   "outputs": [],
   "source": [
    "protokol = {\n",
    "    \"Flask\": \"WSGI\",\n",
    "    \"Starlette\": \"ASGI\",\n",
    "    \"FastAPI\": \"ASGI\",\n",
    "    \"Gunicorn\": \"WSGI\",\n",
    "    \"Uvicorn\": \"ASGI\",\n",
    "}\n",
    "\n",
    "for imya, tip in protokol.items():\n",
    "    print(imya, \"->\", tip)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "664f48ff",
   "metadata": {},
   "source": [
    "## Sprawdzenie wyniku"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e9878429",
   "metadata": {},
   "outputs": [],
   "source": [
    "assert protokol[\"Flask\"] == \"WSGI\"\n",
    "assert protokol[\"FastAPI\"] == \"ASGI\"\n",
    "assert protokol[\"Uvicorn\"] == \"ASGI\"\n",
    "assert protokol[\"Gunicorn\"] == \"WSGI\"\n",
    "print(\"Верно: сопоставление совпадает с разделом 22.19 сайта.\")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Cartesian Python 3.14",
   "language": "python",
   "name": "cartesian-python314"
  },
  "language_info": {
   "name": "python",
   "version": "3.14.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
