Python Flask Advanced Programming

Source: Internet
Author: User
Tags virtual environment


The 1th chapter of course Introductory
Introduce the contents of the course
1-1 at the outset
1-2 Course Maintenance and questions

The 2nd Chapter Flask Basic Principles and core knowledge
In this chapter we first introduce the best package and virtual environment management tools that Python has officially recommended: Pipenv. Then we will learn the unique URL principle, redirect, Response object response.
2-1 Fish Book is a What kind of product
2-2 preparatory work
2-3 Create a virtual environment using the official recommended pipenv (very easy to use OH ~)
2-4 Recommended Development Tools
2-5 Setting the default interpreter for development tools
2-6 Flask Minimum prototype and unique URL principle
2-7 another way to register a route
2-8 App.run related parameters and flask configuration file
2-9 you don't really understand the role of if __name__
2-10 Response object: Response

Chapter 3rd data and Flask routing
In this chapter, we focus on the data acquisition, the code of view functions, the Flask routing principle (deep source). In addition, we will explain common python application myths, such as the problems caused by circular import.
3-1 search instead of photo upload
3-2 Book Search and query 1-Data API
3-3 Book Search and query 2-keyword search
3-4 Book Search and query 3-Simple refactoring
3-5 Get Book Data: Call the Fish Book API
3-6 Requests vs Urllib
3-7 getting data from the API
3-8 using Jsonify
3-9 splitting a view function into a separate file
3-10 deep understanding of flask routing
3-11 Cycle Introduction Process Analysis

4th Chapter Blueprint, model and Codefirst
In this chapter, we try to reconstruct the flask of a single file into a model with a modular meaning, and then we will explore how to use the Codefirst idea to create a database table.
4-1 applications, blueprints, and view functions
4-2 registering view functions with blueprints
4-3 single Blueprint multi-module Split view function
4-4 Request Object
4-5 wtforms Parameter Verification
4-6 Split configuration file
4-7 Model First, Database first, and code first
4-8 Defining a first model class
4-9 mapping a model to a database
The difference between 4-10 Orm and Codefirst

The 5th Chapter Flask Core mechanism
The core of flask is two contexts, and these two top and bottom include a large number of Python advanced programming applications. We need to understand the meaning of context and learn the application of Python's context Manager (with) and stack structure by reference to the flask mechanism. We will also learn how to solve the problem by reading the source code. ...
5-1 Flask Classic Error working outside application context
5-2 the relationship between AppContext, RequestContext, flask and request
5-3 detailed flask context and access stack
5-4 flask context and with statements
5-5 __exit__ method for context manager
5-6 read the source to solve the db.create_all problem

Chapter 6th Multi-threading and thread isolation techniques in flask
For the web, multithreading is hard to avoid. In this section, we'll use flask's principles to learn about processes, threads, what is thread safety, what is thread isolation, how to implement thread isolation in Python, and what the localstack mechanism is. By the end of this chapter, you will understand why Python's multithreading still makes sense because of the existence of the Gil (Global interpreter Lock). ...
6-1 what is a process
6-2 Thread Concepts
6-3 Multi-Threading
6-4 Advantages and benefits of multi-threading
6-5 Global Interpreter Lock Gil
6-6 multithreading is meaningful for IO-intensive programs
6-7 the problem of opening flask multithreading
6-8 Thread Isolation
6-9 Thread-isolated objects in flask local
6-10 thread Isolation Stack in Flask: Localstack
6-11 Localstack as the basic usage of-stack-
The meaning of 6-12 localstack as a thread-isolating object
6-13 objects that are thread-isolated in flask
6-14 combing some nouns of flask

7th Chapter The construction of the book Detail page (ViewModel, object oriented and refactoring)
In this chapter we propose a conceptual viewmodel and explain in detail the meaning of viewmodel. In addition to object-oriented although it is commonplace, but do you really understand object-oriented? We'll step through refactoring in this chapter to reveal exactly what an object is and how to write object-oriented code. The training of thinking is always more important than business. ...
The basic concept of 7-1 ViewModel
7-2 working with ViewModel on book data
7-3 using ViewModel to process book data
7-4 pseudo-Object-oriented: The process of facing the object-oriented cloak
7-5 reconstructing the Fish book core object: Yushubook
7-6 reconstructing the Fish book core object: Yushubook
7-7 code interpretation Right reversal from JSON serialization
7-8 the difference between a single page and a website

8th chapter static files, templates, messages Flash and JINJA2
In this chapter, we will study indirectly through the template of learning Flask: Application of List derivation, application of ternary expression, @Property attribute descriptor, application of filter function, Pipeline filter. This knowledge we have learned in the introductory and advanced courses, but how exactly do they use it? That's a problem. We will explain each of these in this chapter. ...
8-1 principle of static file access
8-2 Location and modification scheme of template files _x264
The concept of 8-3 JINJA2
8-4 reading dictionaries and objects in JINJA2
8-5 Flow Control Statement if
8-6 flow control statement for in loop
8-7 using template Inheritance
8-8 Filters and Piping commands
8-9 Reverse Build URL
8-10 message flashes, Secretykey, and variable scopes
8-11 Show Search Results page
8-12 Page Structure parsing

9th Chapter User Login and Registration
In this chapter we use the Flask-login plugin to handle user login and registration. At the same time we will use login and registration to learn flask in the cookie, redirect, and redirect The hidden Danger: redirect attack. In addition, we will introduce the Python getter and setter of the magical.
The embodiment of 9-1 viewmodel meaning and the ingenious application of filter function
9-2 book details page business logic analysis
9-3 implementing the book details page
9-4 model and model relationship
9-5 customizing the base class model
9-6 User Registration
Dynamic assignment of 9-7 python
9-8 Python Property Descriptor implementation getter and setter
9-9 ORM Way to save the model
9-10 Custom Validator
9-11 REDIRECT redirect
9-12 Cookies
Application of 9-13 Cookies
9-14 Login_user Writing user information to cookies
9-15 access Rights control
9-16 REDIRECT Attacks

10th Book Trading Model (database transactions, overriding objects in flask)
This chapter is a comprehensive application chapter. We will see how to use multiple Python knowledge points to solve the problem comprehensively. We will further use @contextmanager to improve the context manager we learned earlier and combine yield to optimize database transactions. In addition, we will rewrite the methods of some objects in flask to implement our own business logic. ...
10-1 Fish Beans
10-2 Thinking Logic Workout
10-3 Transaction and Rollback
10-4 Python @contextmanager
10-5 flexible use of @contextmanager
10-6 combine inheritance, yield, contextmanager, rollback to solve problems
Traps for class 10-7 variables
10-8 using Ajax wisely
10-9 Book Trading View model
10-10 processing Time
10-11 Book details page
10-12 re-talk about model in MVC
10-13 rewrite filter_by

11th Octopus Book Business Processing
In this chapter we will use the flask and Python knowledge we learned earlier to focus our business. Includes: recently uploaded books (home page), gift list and giving list, Bobber and personal center, etc.
11-1 Recent gifts (Complex SQL authoring scheme)
11-2 Chaining calls
11-3 Complete the latest gift (four ways to write a business)
11-4 My gift One (query with db.session and filter)
11-5 my present two (group_by with Funct.count statistics combined)
11-6 My gift three (do not return tuples in a function, but should return a dictionary)
11-7 my present Four
11-8 User Logoff
11-9 my wish is one
11-10 My Wish II (talk about the solution of the Loop import again)
11-11 my wish three (talk about packaging tips for repeating code)

12th Chapter The combination of Python and flask application
In the introduction and advanced of Python3, we explained the decorator in detail, but how should the decorator be used? This chapter uses a high-level adorner with parameters to achieve the frequency limit for sending messages. We will also analyze the multiple inheritance features in SQLAlchemy and use iterators to improve and optimize our code.
12-1 forgot password (reset password process analysis)
12-2 first_or_404
12-3 callable The meaning of callable objects
12-4 HttpException A
12-5 HttpException II
Application of the 12-6 adorner APP_ERRORHANDLER:AOP
12-7 Send e-mail one
12-8 Send e-mail two
12-9 Generating Tokens using itsdangerous
12-10 Reset Password
12-11 sending e-mail asynchronously
12-12 Bobber business logic and drift model
12-13 reasonable use of data redundancy to record historical status
12-14 Bobber Condition Detection
12-15 Complete Bobber business logic
12-16 Transaction History page
12-17 Drift ViewModel A
12-18 Drift ViewModel II
12-19 three summary and comparison of species patterns
12-20 better use of enumerations
12-21 Super Power Phenomenon Guard
12-22 Deny request
12-23 Mailing Success
12-24 Withdrawing gifts and wishes
12-25 giving books to others

: Baidu Network Disk download

Python Flask Advanced Programming

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.