|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/create-apps-with-fastapi/
课程评论:没有评论
课程名称:《FastAPI超级指南:创建3个真实世界的FastAPI应用》 课程概述:全栈网页开发涉及多个方面,包括数据库、REST架构、HTTP请求、OAuth2等协议,这些内容可能令学习者感到困惑,尤其是与复杂的FastAPI框架及Python的细节结合时。本课程旨在从基础到高级层面消除这种困惑,通过理论与实践结合的方式,全面教授FastAPI。同时,学员将在学习过程中构建三个主要使用Python编写的全栈网页应用。 在本课程中,您将会: - 使用FastAPI创建3个全栈应用,遵循行业标准做法。 - 使用Jinja2、Bootstrap、HTML和CSS创建具有控制流(条件语句、循环等)的前端模板。 - 理解REST API架构及在FastAPI中实施REST API的基本方法。 - 利用数据库浏览器和SQLAlchemy创建、管理、更新和解析SQLite数据库。 - 创建用户认证和注册逻辑,并进行错误处理。 - 理解HTTP的工作原理及其请求的方法、头部、主体和状态码。 - 格式化程序数据并在前端页面中呈现。 - 在Python中解析HTTP请求并提取相关数据(包括参数、表单数据和请求主体)。 - 验证HTTP路由并在REST API和全栈应用中实施错误处理。 - 理解JSON数据的解析和返回。 - 使用Pydantic和类型提示在Python中创建数据模型和模式。 - 在Python中进行密码哈希和验证。 - 创建OAuth2流程并使用这些流程来认证用户。 - 创建、管理和更新JSON Web令牌。 - 在Python中创建数据库模型,并将其与FastAPI路由结合使用。 - 使用Alembic进行数据库迁移和更新。 - 学习最佳的网页开发实践和规范。 课程要求:不需要了解FastAPI、网页路由、安全性等方面的知识,基本的Python理解和对HTML、CSS的熟悉即可开始学习。 课程大纲:在构建应用之前,课程将综合介绍Python基础知识,包括类型提示、Pydantic模型,以及使开发更加轻松的Python特性和虚拟环境等。每个部分结束会有编码练习和小测验,确保学习者掌握所学内容。 接下来,将开始建造三个全栈网页应用程序: 1. 第一个应用关注FastAPI的基本概念,涉及REST API架构、Jinja2、Bootstrap和HTML模板等,建立一个汽车信息查看器,允许用户查看、搜索、创建、编辑和删除汽车信息。 2. 第二个应用集中于网络安全,涉及OAuth2流程、密码哈希、JSON网络令牌等,构建一个社交媒体动态,包含用户登录和注册功能。 3. 第三个应用聚焦于数据库使用,基于SQLite和SQLAlchemy创建和建模数据库,结合Alembic进行数据库迁移,构建一个待办事项列表,整合全部FastAPI、Python和OAuth2的学习内容。 准备好在FastAPI和Python中进行网页开发了吗?现在就加入我们,开启您的FastAPI学习之旅吧!
There is a lot that goes into full stack web development.With databases, REST architecture, HTTP requests, OAuth2, and all the other protocols that go alongside full stack web development, it can be hard to learn, especially when coupled with a complicated framework like FastAPI and the nuanced parts of Python.This course aims to eliminate that confusion by teaching FastAPI from the very basics to the advanced level. It combines theory and practical use to give you everything you need to learn FastAPI, all while allowing you to build 3 full-stack web applications written primarily in Python along the way.Throughout the course, you will:Create 3 full-stack applications using FastAPI in Python and industry-standard practicesUse Jinja2, Bootstrap, HTML, and CSS to create front-end templates with control flow (conditionals, loops, etc.)Fundamentally understand REST API architecture and how to implement REST APIs in FastAPIUse database browsers and SQLAlchemy to create, manage, update, and parse SQLite databasesCreate user authentication and registration logic with error handlingUnderstand HTTP, how it works, and how to make requests, including methods, headers, bodies, and status codesFormat programmatic data to include in front-end pagesParse HTTP requests in python and extract relevant data, including parameters, form data, and request bodiesValidate HTTP routes and implement error handling in REST APIs and full-stack applicationsUnderstand JSON and how to both parse and return it using PythonUse Pydantic and type hints to create data models and schemas in PythonHash and verify passwords in PythonCreate OAuth2 flows and use them to authenticate users using FastAPI logicCreate, manage, and update JSON Web TokensCreate database models in Python and use them with FastAPI routesUse Alembic to migrate and update databasesUse SQLAlchemy to write functionality to interact with databases in PythonLearn best web development practices and conventionsAnd much more!And the best part is; you don't have to know anything about FastAPI, web routing, security, or any of the above. All you need is a basic understanding of Python and some familiarity with HTML and CSS, and you will be on your way to becoming a master of full stack web development in Python and FastAPI!The curriculum takes a comprehensive look at both FastAPI and the technologies needed to build it. Before we start building any apps, we take a look at the basics of Python, including:Type hintsPydantic modelsNuanced Python features that make development much easier, such as virtual environments. At the end of section, there is a coding exercise and quiz that incorporate all content covered to ensure understanding.Once the basics are covered, we start by building the first of three full stack web applications. In the first app, we focus on the basics of FastAPI by teaching:REST API architectureJinja2BootstrapHTML templatingThe foundational FastAPI skills needed to get a basic application up and running. Along the way, we will be building a car information viewer that lets you view, search, create, edit, and delete information about cars, all delivered in a clean and readable codebase using Python and FastAPI.The home page contains a list of all the cars in our database, which is neatly formatted and displayed to the user in a gridlike manner.The navbar contains working links to the home page, a form to create a car (more on that later!), and an embedded search bar which, when used, takes you to a search page.The search form uses IDs to search the database for cars, and displays them to the user. It also contains error handling in case an invalid ID is passed to the user.Each car on the page has edit and delete buttons, with the edit button taking you to an auto-filled form on a separate page to edit the data, and the delete button passing a request to a hidden route that removes it from the database.The create form is identical to the edit form, except it has no auto-filled data. When completed, it will redirect to the home page, where the newly created car will be available to view.The second app focuses on web security, incorporating:OAuth2 flows and schemesPassword hashingJSON web tokensFastAPI-specific authentication systemsAnd industry-standard practices into a main FastAPI application written in Python.This will be built around a social media feed that uses login and registration functionality to display user information under a protected page.The home page is available to everyone, and contains some basic text prompting the user to login. The navbar contains links to a login, registration, and logout page, all with custom error messaging to ensure new users are unique and attempted logins are properly authenticated.The protected page contains data about the user which is displayed in a responsive grid to the user. This displays user information, friends, and notifications.The logout feature removes any of the authentication applied to the web session and redirects to the homepage.The third app focuses on databases, using SQLite and SQLAlchemy to build and model databases in Python and FastAPI. You will also learn to use Alembic in combination with SQLAlchemy to perform database migrations and updates. These topics will be built around a todo list that combines user login with SQLite databases to create a full stack web application, incorporating all the elements of FastAPI, Python, OAuth2, and all the other practices learned up to that point.Similar to the second app, the homepage is available to everyone and prompts the user to log in.The login, registration, and logout features use the same FastAPI logic to handle authentication as the previous app, except this time, data is being pulled from a real SQLite database. This is combined with past knowledge to create authentication that works with FastAPI.The todo page contains a list of all the tasks that pertain to the user. At the bottom of the list is a form that lets you add a new task, which sends a request to a route that handles parsing and adding the task to the user's list of tasks through advanced, FastAPI-specific Python logic.So, are you ready to start crushing web development and building full stack web applications in FastAPI and Python? Enroll and start your FastAPI journey today!