Building REST APIs with Flask: Create Python Web Services with MySQL

Building REST APIs with Flask: Create Python Web Services with MySQL

by Kunal Relan

Paperback(1st ed.)

$29.69 $32.99 Save 10% Current price is $29.69, Original price is $32.99. You Save 10%.
Choose Expedited Shipping at checkout for guaranteed delivery by Tuesday, October 22


Develop RESTful web services using the Flask micro-framework and integrate them using MySQL. Use Flask to develop, deploy, and manage REST APIs with easy-to-read and understand Python code. Solve your problem from a choice of libraries. Learn to use MySQL as the web services database for your Flask API using SQLAlchemy ORM.

Building REST APIs with Flask provides a primer on Flask, RESTful services, and working with pip to set up your virtual environment. The key differences between NoSQL and SQL are covered, and you are taught how to connect MySQL and Flask using SQLAlchemy. Author Kunal Relan presents best practices for creating REST APIs and guides you in structuring your app and testing REST endpoints. He teaches you how to set up authentication and render HTML using views. You learn how to write unit tests for your REST APIs, and understand mocks, assertions, and integration testing. You will know how to document your REST APIs, deploy your Flask application on all of the major cloud platforms, and debug and monitor your Flask application.

What You'll Learn

• Use MySQL to create Flask REST APIs

• Test REST endpoints

• Create CRUD endpoints with Flask and MySQL

• Deploy Flask on all of the major cloud platforms

• Monitor your Flask application

Who This Book Is For

Python developers interested in REST API development using Flask and web developers with basic programming knowledge who want to learn how Python and REST APIs work together. Readers should be familiar with Python (command line, or at least pip) and MySQL.

Product Details

ISBN-13: 9781484250211
Publisher: Apress
Publication date: 09/13/2019
Edition description: 1st ed.
Pages: 199
Product dimensions: 6.10(w) x 9.25(h) x (d)

About the Author

Kunal Relan is an iOS security researcher and a full-stack developer with more than four years of experience in various fields of technology including network security, DevOps, cloud infrastructure, and application development working as a consultant with startups around the globe. He is an Alibaba Cloud MVP, and author of iOS Penetration Testing (Apress) and a variety of white papers. Kunal is a technology enthusiast and an active speaker. He regularly contributes to open source communities and writes articles for Digital Ocean and Alibaba Techshare.

Table of Contents

Chapter 1: Beginning with Flask

Chapter Goal: Give the readers a primer on Flask and RESTful services and set up virtual environment for REST API development

No of pages: 20

Sub -Topics
1. Introduction to Flask
2. Introduction to RESTful Services
3. Working with pip
4. Setting up Virtual Environment
5. Explaining the Flask Microframework

Chapter 2: MongoDB and PyMongo

Chapter Goal: Teach the readers the ket differences between NoSQL and SQL. Show readers how to connect MongoDB and Flask using PyMongo.

No of pages: 20

Sub - Topics
1. NoSQL vs SQL
2. Introducing MongoDB
3. Introducing PyMongo
4. Connecting MongoDB with Flask

Chapter 3: Architecting REST API

Chapter Goal: Learn about creating REST APIs along with the best practices associated with them. Readers will also learn to structure their app and test REST endpoints.

No of pages: 30

Sub - Topics:
1. REST 101
2. Python and REST
3. REST Best Practices
4. Structuring the application
5. Testing REST Endpoints

Chapter 4: CRUD with Flask and MongoDB

Chapter Goal: Teach readers how to work with modules and how to create CRUD endpoints using Flask and MongoDB. Readers will also learn to set up Authentication and Rendering HTML using views.

No of pages: 25

Sub - Topics:
1. Working with modules
2. Creating CRUD endpoints using Flask and MongoDB
3. Setting up Authentication
4. Rendering HTML using views

Chapter 5: Testing REST API

Chapter Goal: Teach readers how to write unit tests for their REST APIs. Readers will also learn about mocks, assertions and Integratioin Testing

No of pages: 20

Sub - Topics:
1. Introducing Unit Testing Framework
2. Writing unit tests for the APIs3. Mocks and Integratioin Testing\
4. Assertions

Chapter 6: Documenting REST APIs

Chapter Goal: Readers will learn to document their REST APIs and also get to know Automated API documentation.

No of pages: 15

Sub - Topics:
1. Documenting APIs 101
2. Generating Automated API documentation

Chapter 7: Deploying REST APIs

Chapter Goal: Readers will learn to deploy their Flask applications using uWSGI and Nginx. They will be deploying their applications on Heroku.

No of pages: 25

Sub - Topics:
1. Deploying Flask Applications 101
2. Introducing uWSGI and Nginx
3. Deploying Flask Application using uWSGI and Nginx
4. Deploying on Heroku

Chapter 8: Debugging and Monitoring

Chapter Goal: Readers will learn to debug and monitor their Flask application.

No of pages: 20

Sub - Topics:
1. Debugging Flask Application 101
2. Debugging Nginx Requests
3. Flask Monitoring
4. Conclusion

Customer Reviews

Most Helpful Customer Reviews

See All Customer Reviews