python - Flask框架的结构
黄舟
黄舟 2017-04-17 14:57:57
0
2
402

今天刚开始看flask的源码,发现各种不懂啊。。
有没有大神讲一下flask的架构是什么?让我从宏观上把握下。。
还有个问题,如何读flask的源码? 我在app=Flask(__name__)设置了断点,然后跟进,那些配置文件的函数读的似懂非懂的,这部分需要读么~
求大神解惑~

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(2)
巴扎黑

ReadingFlask source code is a good thing. Before reading, I suggest you ask yourself the following questions:

  • Are you familiar with the main Flask of API? Do you know a Flask app complete workflow
  • Are you familiar with B/S this kind of framework, are you familiar with the relevant network protocols (HTTP,TCP), are you clear about the client sending a request, the server processing and responding to the request and its details
  • Are you familiar with the gateway interface protocol (Python web) developed by WSGI

If these are all clear, you can read Flask carefully before reading the werkzeug source code.

werkzeug is the foundation of the flask framework. Most of the above problems are implemented in the werkzeug library. FlaskIt is just a more advanced package and designed to be more suitable for developersAPI.

After you are familiar with werkzeug, and then look at Flask, you should not have any confusion about the configuration file.

PS: I am not a master, but I just finished reading the Flask source code recently.

Peter_Zhu

When reading the flask source code, it is recommended to first read the code submitted by flask for the first time on github. It is just a flask.py file, but the basic concepts are already there.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template