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.
By:
Kunal Relan
Imprint: APress
Country of Publication: United States
Edition: 1st ed.
Dimensions:
Height: 235mm,
Width: 155mm,
Weight: 454g
ISBN: 9781484250211
ISBN 10: 1484250214
Pages: 199
Publication Date: 13 September 2019
Audience:
Professional and scholarly
,
Undergraduate
Format: Paperback
Publisher's Status: Active
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 -Topics1. Introduction to Flask2. Introduction to RESTful Services3. Working with pip4. Setting up Virtual Environment5. 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 SQL2. Introducing MongoDB3. Introducing PyMongo4. 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 1012. Python and REST3. REST Best Practices4. Structuring the application5. 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 modules2. Creating CRUD endpoints using Flask and MongoDB3. Setting up Authentication4. 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 Framework2. 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 1012. 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 1012. Introducing uWSGI and Nginx3. Deploying Flask Application using uWSGI and Nginx4. 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 1012. Debugging Nginx Requests3. Flask Monitoring4. Conclusion
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.