Skip to Content
High-Performance Web Apps with FastAPI: The Asynchronous Web Framework Based on Modern Python
book

High-Performance Web Apps with FastAPI: The Asynchronous Web Framework Based on Modern Python

by Malhar Lathkar
March 2023
Intermediate to advanced
321 pages
4h 52m
English
Apress
Content preview from High-Performance Web Apps with FastAPI: The Asynchronous Web Framework Based on Modern Python
© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2023
M. LathkarHigh-Performance Web Apps with FastAPIhttps://doi.org/10.1007/978-1-4842-9178-8_4

4. Templates

Malhar Lathkar1  
(1)
Nanded, Maharashtra, India
 

FastAPI, as its name suggests, is primarily intended to be a library for API development. However, it can very well be used to build web apps of traditional type, that is, the ones rendering web pages, images, and other assets.

In this chapter, we shall learn how FastAPI renders web pages with the help of templates.

This chapter consists of the following topics:
  • HTML response

  • Template engine

  • Hello World template

  • Template with path parameter

  • Template variables

  • Serving static assets

  • HTML form template

  • Retrieve form data ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building Python Web APIs with FastAPI

Building Python Web APIs with FastAPI

Abdulazeez

Publisher Resources

ISBN: 9781484291788Purchase LinkPublisher Website