# air | Feldroy | Knowledge Base | Instagit

The first web framework designed for AI to write. Built on Python, FastAPI, Pydantic, and HTMX. By the authors of Two Scoops of Django.

GitHub Stars: 827

Repository: https://github.com/feldroy/air

---

## Articles

### [How to Create Custom Page Layouts Using air.layouts: Step-by-Step Guide](/feldroy/air/how-do-i-create-custom-page-layouts-using-air-layouts)

Learn to create custom page layouts in air.layouts with this step by step guide. Build flexible Python functions for your web app.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Handle and Display Form Validation Errors in Air](/feldroy/air/how-do-i-handle-and-display-form-validation-errors-in-air)

Learn to handle form validation errors in Air. Air automatically validates Pydantic forms, stores errors efficiently, and renders accessible HTML with aria-invalid attributes for a better user experience.

- Tags: how-to-guide
- Published: 2026-03-01

### [Why Air is Built for AI-Assisted Development: Framework Design Explained](/feldroy/air/why-is-air-designed-for-ai-assisted-development)

Discover why Air is the ideal Python web framework for AI-assisted development. Its typed APIs and explicit defaults empower AI coding assistants to understand and extend your codebase seamlessly.

- Tags: architecture
- Published: 2026-03-01

### [How to Test Air Applications with pytest: A Complete Guide](/feldroy/air/how-do-i-test-air-applications-with-pytest)

Learn to test Air applications effectively with pytest. This guide shows how to leverage FastAPI's TestClient for robust testing of your Air apps.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Deploy Air Applications with Docker and Kubernetes: Production Guide](/feldroy/air/how-do-i-deploy-air-applications-with-docker-and-kubernetes)

Deploy Air applications using Docker and Kubernetes. Build a multi-stage Docker image and apply production-ready Kubernetes manifests with custom probes and security contexts.

- Tags: production-guide
- Published: 2026-03-01

### [Recommended Project Structure for Air Applications: A Complete Guide](/feldroy/air/what-is-the-recommended-project-structure-for-air-applications)

Discover the recommended project structure for Air applications. Learn a minimal Python package layout for efficient routing, asset management, and dependency handling.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Organize Routes in Multiple Files Using AirRouter](/feldroy/air/how-do-i-organize-routes-in-multiple-files-using-airrouter)

Learn to organize routes in multiple files with AirRouter. Keep your codebase modular and maintainable by defining path operations in separate modules and registering them with your app.

- Tags: how-to-guide
- Published: 2026-03-01

### [How Air's Default Exception Handling Works: A Deep Dive into HTML Error Pages](/feldroy/air/how-does-airs-default-exception-handling-work)

Explore how Air's default exception handling registers styled HTML error pages for 404 and 500 errors merging default handlers with your custom callbacks during initialization.

- Tags: deep-dive
- Published: 2026-03-01

### [How to Use BackgroundTasks in Air for Asynchronous Processing](/feldroy/air/how-do-i-use-backgroundtasks-in-air-for-async-processing)

Learn to use BackgroundTasks in Air for asynchronous processing. Offload background work from HTTP responses efficiently using add_task for seamless execution.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Mount a FastAPI Sub-App Inside an Air Application](/feldroy/air/how-do-i-mount-a-fastapi-sub-app-inside-an-air-application)

Learn to mount a FastAPI sub-app within an Air application using Air.mount(). This efficient method integrates FastAPI seamlessly, leveraging its native mounting capabilities for a smooth experience.

- Tags: how-to-guide
- Published: 2026-03-01

### [How the AirRoute Class Customizes FastAPI Routing in Air](/feldroy/air/how-does-airs-airroute-class-customize-fastapi-routing)

Discover how AirRoute enhances FastAPI routing by transforming requests, resolving type annotations, and adding reverse URL helpers. Learn more about this powerful customization.

- Tags: internals
- Published: 2026-03-01

### [How to Configure path_separator (Dash vs Slash) in AirRouter](/feldroy/air/how-do-i-configure-path-separator-dash-vs-slash-in-airrouter)

Configure AirRouter path_separator to use dashes or slashes for URL path segments, controlling how Python function names are converted for cleaner URLs.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Use the `.url()` Method for URL Generation in Air Routes](/feldroy/air/how-do-i-use-the-url-method-for-url-generation-in-air-routes)

Learn to generate URLs in Air routes using the .url() method. Easily perform reverse URL lookup with optional query parameters for your web applications.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Implement Server-Sent Events with SSEResponse in Air](/feldroy/air/how-do-i-implement-server-sent-events-with-sseresponse)

Implement Server-Sent Events with air SSREsponse by wrapping async generators. Automatically format chunks for SSE with headers and data prefixes. Stream real-time updates efficiently.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Configure SessionMiddleware for User Sessions in Air](/feldroy/air/how-do-i-configure-sessionmiddleware-for-user-sessions)

Configure SessionMiddleware for user sessions in Air with a secret key to enable signed cookie-based sessions accessible via request.session. Optimize your application today.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Create Custom Form Widgets in Air: A Complete Guide](/feldroy/air/how-do-i-create-custom-form-widgets-in-air)

Learn how to create custom form widgets in Air with this complete guide. Explore options like Model.to_form(), subclassing AirForm, or setting the widget attribute for tailored HTML output.

- Tags: how-to-guide
- Published: 2026-03-01

### [How AirModel.to_form() Automatically Generates AirForm Classes in Air](/feldroy/air/how-does-airmodel-to-form-automatically-generate-airform-classes)

Discover how AirModel.to_form() automatically generates AirForm classes. Learn how this helper dynamically creates subclasses using Python's type() for efficient form generation.

- Tags: deep-dive
- Published: 2026-03-01

### [How to Combine Jinja Templates with Air Tags in Python Views](/feldroy/air/how-do-i-combine-jinja-templates-with-air-tags-in-the-same-view)

Easily combine Jinja templates with Air Tags in Python views. Learn how to render Jinja into SafeStr objects for seamless embedding and dynamic content creation.

- Tags: how-to-guide
- Published: 2026-03-01

### [@app.page vs @app.get in Air: What’s the Difference?](/feldroy/air/whats-the-difference-between-app-page-and-app-get-decorators)

Understand the difference between @app.page and @app.get in the feldroy/air framework. Learn how @app.page automatically sets routes from function names for efficient web development.

- Tags: deep-dive
- Published: 2026-03-01

### [How AirForm Uses Pydantic for Form Validation: A Complete Guide](/feldroy/air/how-does-airform-use-pydantic-for-form-validation)

Discover how AirForm leverages Pydantic for robust form validation. This guide explains AirForm's integration with Pydantic BaseModel for automatic validation, error handling, and rendering.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Create Custom Air Tags for HTML Rendering: A Complete Guide](/feldroy/air/how-do-i-create-custom-air-tags-for-html-rendering)

Learn to create custom Air Tags for HTML rendering by subclassing BaseTag or Transparent from feldroy/air. Override init to set defaults and register automatically for custom HTML elements.

- Tags: how-to-guide
- Published: 2026-03-01

### [How Air Uses Composition Over FastAPI Internally: Architecture and Implementation](/feldroy/air/how-does-air-use-composition-over-fastapi-internally)

Discover how Air uses composition over FastAPI internally. Learn about its architecture and implementation, storing FastAPI within self._app for HTML-first applications while retaining full engine access.

- Tags: architecture
- Published: 2026-03-01

