--- title: FastHTML Hello World permalink: /futureproof/fasthtml-hello-world/ description: Learn the basics of FastHTML, a Python web framework that skips templating languages and allows direct HTML element creation with Python functions. Discover how to build a simple "Hello World" page with structured HTML using FastHTML's function-to-element mapping. meta_description: "FastHTML 'Hello World' tutorial: Create web pages using Python functions (e.g., `H1()`, `Body()`) that map to HTML elements, skipping template languages." meta_keywords: FastHTML, Hello World, Python web framework, HTML generation, Python functions, no templates, introduction, tutorial, Flask alternative, inline style, @rt, fast_app layout: post sort_order: 1 --- FastHTML is not FastAPI and your AI coding assistants will need frequent reminding. There is no template language but Python function names. See... ```python from fasthtml.common import * app, rt = fast_app() @rt("/") def home(): return "Hello World!" serve() ``` This will return Hello World with a request to the page, but it won't have any of the HTML tags that, well, make it HTML, so let's add those... ```python from fasthtml.common import * app, rt = fast_app() @rt("/") def home(): return Html( Head( Title("SSE Proof of Concept") ), Body( H1("Hello World!") ) ) serve() ``` If you view-source the HTML, you'll see: ```html