Duration
3 days
OVERVIEW
Back end development is hotter than ever before. The back end is the foundation on which the application or website is built on. While the end user might not see it, it is the brain of the site making everything run like clockwork. For established as well as upcoming developers, mastering a powerful back end tool such as Flask can open up a lot of opportunities. This micro framework from Python is simple, powerful and flexible allowing faster development of code that is easier to read, write and maintain.
Flask training workshop is designed to give a strong foundation of web development, Python and Flask. Participants will learn about models, views, controllers, web templates, forms, validation, and API interactions in Flask. Through a hands on and experiential course format participants will master Flask and learn to build very own custom web apps with Flash.
PROGRAM OBJECTIVES
All students will:
- Connect web or mobile applications to databases and servers via REST APIs
- Create secure and reliable REST APIs which include authentication, logging, caching, and more
- Understand the different layers of a web server and how web applications interact with each other
- Handle seamless user authentication with advanced features like token refresh
- Handle log-outs and prevent abuse in your REST APIs with JWT blacklisting
- Develop professional-grade REST APIs with expert instruction
WHO SHOULD ATTEND
- Anyone who needs to learn how to write API in Python
- Anyone who wants a solid exposure to JSON Restful API
- Anyone who needs to learn Flask framework
PREREQUISITE
Participants should already be comfortable using the operating system Windows and the programming language Python. All students should have a knowledge of HTML5 and CSS.
COURSE OUTLINE
- Getting Started
Introduction
- What is Flask
- Why use Flask
- Installing Flask
- Simple Views
- HTTP Methods
- Returning content
- Templates and variables
- Organizing the Application
- Configuring routes
- Static files
- Configuration
- Context locals
- Sessions
- Integrating a SQLite Database
- The g (global) object
- Creating a table
- Inserting rows
- Making queries
- Jinja Templates
- The big picture
- Simple syntax
- Block statements
- Loading and rendering
- Inheritance
- Advanced syntax
- Filters and tests
- HTTP Responses
- String responses
- Setting the status code
- Getting the response object
- Adding response headers
- HTML Forms
- Simple forms
- Form submission
- Retrieving user data
- Re-submitting forms
- Advanced Topics
- Redirects
- Auto-escaping HTML
- Message flashing
- Built-in decorators
- Error Handling
- Handling an unrouted URL
- Aborting a page view
- Customizing the error page
- Testing and Debugging
- Getting Started with API based Development
- Installing Postman
- Using Postman for API testing
- First Flask Application
- List of Books from API
- Single Book from API
- Summary
- Posting Data
- Adding a POST Route
- Getting the Request Body Sent by a Client
- Sending POST Requests to Flask App
- Sanitizing data sent in POST Request
- Testing - how well we sanitize the Invalid Request Bodies
- Adding new Books
- Mistake to be aware of when using POST in Flask
- Status codes for POST requests
- Response bodies for POST requests
- Location headers for POST Requests in Flask
- Handling Invalid Post Request
- Summary
- Updating Data
- Adding a PUT Route
- Reading the Client’s Request Body
- Sending PUT Requests to Flask
- Finishing up the PUT Route
- Adding a PATCH Route
- Defining PATCH Route
- Finishing up PATCH Route
- Summary
- Deleting Data
- Adding a DELETE Route
- Coding DELETE Route
- Sending DELETE Requests to Flask App
- Finishing Up DELETE Route
- Summary
- Storing Data in Database
- Configuring a Flask SQLAlchemy Database
- Defining Tables and Columns in Flask SQLAlchemy
- Creating the Database
- Defining the Data Model with Flask SQLAlchemy
- Updating Our Data Model to Delete Entries from our Database
- Updating Our Data Model to Update Table Entries
- Updating Our Data Model to Replace Table Entries
- Returning Back JSON from Our Data Model
- Updating Our Flask App to Use Our Book Model
- Verifying the Book Model integration was successful
- Summary
- Adding Authentication to Our API
- How to create JWT Tokens
- Adding Authentication for Our Get Route
- Creating a Database for Users who are Allowed API Access
- Creating Users that are allowed API Access
- Having users login to Get a Token
- Creating Decorators to Add API Authentication
- Adding Authentication for all our Routes using Decorators
- Summary
- Conclusion
Programme scope, delivery arrangements and suitability are confirmed during enquiry.