- Flask Blueprints
- Jo?l Perras
- 590字
- 2021-07-30 10:17:00
What this book covers
Chapter 1, Starting on the Right Foot – Using Virtualenv, kicks off our dive into Python web application development with the basics of using and managing virtual environments to isolate the application dependencies. We will look at the setup tools, pip, libraries, and utilities that are used to install and distribute reusable packages of Python code, and virtualenv, a tool to create isolated environments for the Python-based software requirements of a project. We will also discuss what these tools are not able to do, and look at the virtualenvwrapper abstraction to augment the functionality that virtualenv provides.
Chapter 2, Small to Big – Growing the Flask Application Structure, explores the various baseline layouts and configurations that you might consider for a Flask application. The pros and cons of each approach are outlined as we progress from the simplest one-file application structure to the more complex, multipackage Blueprint architecture.
Chapter 3, Snap – the Code Snippet Sharing Application, builds our first simple Flask application centered around learning the basics of one of the most popular relational database abstractions, SQLAlchemy, and several of the most popular Flask extensions: Flask-Login to handle authenticated user login sessions, Flask-Bcrypt to ensure that account passwords are stored in a secure manner, and Flask-WTF to create and process form-based input data.
Chapter 4, Socializer – the Testable Timeline, builds a very simple data model for a social web application where the main focus is on unit and functional testing using pytest, the Python testing framework and tools. We will also explore the use of the application factory pattern, which allows us to instantiate separate versions of our application for the purposes of simplifying testing. Additionally, the use and creation of often-omitted (and forgotten) signals, provided by the Blinker library, are described in detail.
Chapter 5, Shutterbug, the Photo Stream API, builds a skeleton of an application around a JSON-based API, which is a requirement for any modern web application these days. One of the many API-based Flask extensions, Flask-RESTful, is used to prototype the API, where we also delve into simple authentication mechanisms for stateless systems and even write a few tests along the way. A short detour is made into the world of Werkzeug, the WSGI toolkit that Flask is built upon, to build a custom WSGI middleware that allows the seamless handling of URI-based version numbers for our nascent API.
Chapter 6, Hublot – Flask CLI Tools, covers a topic that is often omitted from most web application framework discussions: command-line tools. The use of Flask-Script is explained, and several CLI-based tools are created to interact with the data models of our application. Additionally, we will build our very own custom Flask extension that wraps an existing Python library to fetch the repository and issue information from the GitHub API.
Chapter 7, Dinnerly – Recipe Sharing, introduces the somewhat intimidating concept of the OAuth authorization flow that many large web applications, such as Twitter, Facebook, and GitHub, implement in order to allow third-party applications to act on behalf of the account owners without compromising basic account security credentials. A barebones data model is constructed for a recipe-sharing application that allows the so-called social sign in and the ability to cross-post the data from our application to the feeds or streams of the services that a user has connected. Finally, we will introduce the concept of database migrations using Alembic, which allow you to synchronize your SQLAlchemy model metadata with the schemas of the underlying relational database tables in a reliable manner.
- 從0到1:HTML+CSS快速上手
- C#應用程序設計教程
- Learning AngularJS for .NET Developers
- R Data Science Essentials
- Spring 5 Design Patterns
- Java并發編程:核心方法與框架
- Android系統下Java編程詳解
- 程序員必會的40種算法
- Mastering VMware vSphere Storage
- Mastering Responsive Web Design
- ASP.NET開發技巧精講
- 趣學Python游戲編程
- 一個APP的誕生:從零開始設計你的手機應用
- 編程改變生活:用Python提升你的能力(基礎篇·微課視頻版)
- Java核心技術第10版(套裝共2冊)