My Account Log in

1 option

Mastering Flask Web and API Development : Build and Deploy Production-Ready Flask Apps Seamlessly Across Web, APIs, and Mobile Platforms / Sherwin John C. Tragura.

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Tragura, Sherwin John C., author.
Language:
English
Subjects (All):
Application software--Development.
Application software.
Web applications.
Web site development.
Python (Computer program language).
Physical Description:
1 online resource (494 pages)
Edition:
First edition.
Place of Publication:
Birmingham, England : Packt Publishing, [2024]
Biography/History:
Tragura Sherwin John C. : Sherwin John C. Tragura is currently a subject matter expert and technical consultant in a company in the Philippines. He has been part of many development teams customizing Alfresco DMS/RMS and building Java and Python standalone and web projects. He is also a certified professional and bootcamp technical trainer who has delivered technical training on Java, Jakarta EE, C#, .NET, Python, Node frameworks, and other customized training courses since 2011. He was also associated as a lecturer with the Dela Salle University-Manila, Colegio de San Juan de Letran-Calamba, and the University of the Philippines-Los Banos. He is the author of other Packt books, including Spring MVC Blueprints, Spring 5 Cookbook, and Building Python Microservices with FastAPI.
Summary:
Chapter 4: Utilizing Flask Extensions -- Technical requirements -- Applying database migration with Flask-Migrate -- Installing Flask-Migrate and Flask-SQLAlchemy -- Setting up the Alembic configuration -- Creating the migrations -- Applying the database changes -- Designing the UI using Bootstrap-Flask -- Setting up the UI module -- Applying the Bootstrap files and assets -- Utilizing built-in features -- Building Flask forms with Flask-WTF -- Creating the form models -- Rendering the forms -- Applying CSRF -- Submitting the form -- Validating form fields
Contents:
Cover
Title Page
Copyright and Credits
Dedication
Contributors
Table of Contents
Preface
Part 1: Learning the Flask 3.x Framework
Chapter 1: A Deep Dive into the Flask Framework
Technical requirements
Setting up the project baseline
Installing the latest Python version
Installing the Visual Studio (VS) Code editor
Creating the virtual environment
Installing the Flask 3.x libraries
Creating the Flask project
Creating routes and navigations
Creating static URLs
Assigning multiple URLs
Applying path variables
Assigning URLs externally
Implementing class-based views
Managing request and response data
Retrieving the request object
Creating the response object
Implementing page redirection
Implementing view templates
Creating web forms
Building the data layer with PostgreSQL
Setting up database connectivity
Implementing the repository layer
Creating the service layer
Managing the project structure
Building the directory structure
Setting up a development environment
Implementing the main.py module
Creating environment variables
Summary
Chapter 2: Adding Advanced Core Features
Structuring huge and scalable projects
Using the application factory
Using the Blueprint
Utilizing both the application factory and the Blueprint
Applying object-relational mapping (ORM)
Setting up the database connectivity
Building the model layer
Configuring the logging mechanism
Creating user sessions
Managing session data
Clearing all session data
Applying flash messages
Utilizing some advanced Jinja2 features
Applying with-blocks and macros
Applying filters
Adding comments
Implementing error-handling solutions.
Using the register_error_handler method
Applying the @errorhandler decorator
Creating custom exceptions
Managing built-in exceptions
Triggering the error handlers
Adding static resources
Accessing the assets in the templates
Chapter 3: Creating REST Web Services
Setting up a RESTful application
Implementing API endpoints
Managing requests and responses
Utilizing response encoders and decoders
Filtering API requests and responses
Handling exceptions
Consuming API endpoints
Chapter 4: Utilizing Flask Extensions
Applying database migration with Flask-Migrate
Installing Flask-Migrate and Flask-SQLAlchemy
Setting up the Alembic configuration
Creating the migrations
Applying the database changes
Designing the UI using Bootstrap-Flask
Setting up the UI module
Applying the Bootstrap files and assets
Utilizing built-in features
Building Flask forms with Flask-WTF
Creating the form models
Rendering the forms
Applying CSRF
Submitting the form
Validating form fields
Building RESTful services with Flask-RESTful
Implementing session handling with Flask-Session
Applying caching using Flask-Caching
Adding mail features using Flask-Mail
Part 2: Building Advanced Flask 3.x Applications
Chapter 5: Building Asynchronous Transactions
Creating asynchronous Flask components
Implementing asynchronous views and endpoints
Implementing the async before_request and after_request handlers
Creating asynchronous error handlers
Building an asynchronous SQLAlchemy repository layer
Setting up the DB connectivity
Building the asynchronous repository layer
Utilizing the asynchronous DB transactions
Implementing async transactions with asyncio.
Utilizing asynchronous signal notifications
Constructing background tasks with Celery and Redis
Setting up the Celery task queue
Installing the Redis DB
Setting up the Celery client configuration
Creating the Client instance
Implementing the Celery tasks
Running the Celery worker server
Utilizing the Celery tasks
Building WebSockets with asynchronous transactions
Creating the client-side application
Creating server-side transactions
Creating a Flask API client application
Implementing asynchronous SSE
Implementing the message publisher
Building the server push
Applying reactive programming with RxPy
Choosing Quart over Flask 2.x
Chapter 6: Developing Computational and Scientific Applications
Uploading CSV and XLSX documents for computing
Using the pandas module for data and graphical analysis
Utilizing the DataFrame
Rendering graphs and charts using matplotlib
Rendering multiple line graphs
Rendering a pie chart from a CSV file
Rendering multiple Axes plots
Implementing symbolic computation with visualization
Solving linear equations
Solving non-linear formulas
Finding solutions for a linear system
Plotting mathematical expressions
Creating and rendering LaTeX documents
Rendering LaTeX documents
Creating LaTeX documents
Building graphical charts with frontend libraries
Plotting with Chart.js
Creating graphs with Plotly
Visualizing data using Bokeh
Building real-time data plots using WebSocket and SSE
Utilizing the WebSocket
Using SSE
Using asynchronous background tasks for resource-intensive computations
Incorporating Julia packages with Flask
Creating a custom Julia package
Configuring Julia accessibility in a Flask project
Implementing Julia functions in the package.
Creating the Julia service module
Chapter 7: Using Non-Relational Data Storage
Managing non-relational data using Apache HBase
Designing HBase tables
Setting up the baseline requirements
Configuring Apache Hadoop
Configuring Zookeeper and Apache HBase
Setting up the HBase shell
Creating the HBase tables
Establishing an HBase connection
Building the repository layer
Applying a repository to API functions
Running the thrift server
Utilizing the column storage of Apache Cassandra
Designing Cassandra tables
Installing and configuring Apache Cassandra
Running the CQL shell client
Establishing a database connection
Storing search data in Redis
Installing the Redis server
Understanding the Redis database
Implementing the model layer
Handling BSON-based documents with MongoDB
Installing and configuring the MongoDB server
Implementing the repository
Managing key-based JSON documents with Couchbase
Installing and configuring the database instance
Setting up the server connection
Creating the repository layer
Establishing a data relationship with Neo4J
Installing Neo4J Desktop
Establishing a connection to the database
Chapter 8: Building Workflows with Flask
Building workflows with Celery tasks
Creating task signatures
Utilizing Celery primitives
Implementing a sequential workflow
Passing inputs to signatures
Running independent and parallel tasks
Using callbacks to manage task results
Creating BPMN and non-BPMN workflows with SpiffWorkflow.
Setting up the development environment
Creating a BPMN diagram
Implementing the BPMN workflow
Distinguishing between workflow specifications and instances
Identifying between task specifications and instances
Passing form data to UserTask
Adding input variables to ScriptTask
Managing the result of the workflow
Implementing a non-BPMN workflow
Running a non-BPMN workflow
Building service tasks with the Zeebe/Camunda platforms
Setting up the Zeebe server
Installing the pyzeebe library
Creating a BPMN diagram for pyzeebe
Creating a pyzeebe worker
Implementing the pyzeebe client
Building API endpoints
Using Airflow 2.x in orchestrating API endpoints
Installing and configuring Airflow 2.x
Creating tasks
Utilizing Airflow built-in REST endpoints
Implementing workflows using Temporal.io
Setting up the environment
Implementing activities and a workflow
Building a worker
Running activities
Chapter 9: Securing Flask Applications
Adding protection from web vulnerabilities
Applying form validation to request data
Sanitizing form inputs
Securing response data
Rendering Jinja2 variables
Adding security response headers
Using HTTPS to run request/response transactions
Managing user credentials
Encrypting user passwords
Using sqlalchemy_utils for encrypted columns
Utilizing the server-side sessions
Implementing web form authentication
Preventing CSRF attacks
Implementing user authentication and authorization
Utilizing the Flask-HTTPAuth module
Utilizing the Authlib module
Controlling the view or API access
Part 3: Testing, Deploying, and Building Enterprise-Grade Applications
Chapter 10: Creating Test Cases for Flask
Technical requirements.
Creating test cases for web views, repository classes, and native services.
Notes:
Includes index.
Description based on publisher supplied metadata and other sources.
Description based on print version record.
ISBN:
9781837638574
OCLC:
1450101482

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

Find

Home Release notes

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Find catalog Using Articles+ Using your account