Only understand the basic python syntax. After reading the web part of thefoudationofpythonwebprogramming, I feel nothing to gain. Wsgi is reading but does not understand it .. I don't know where to start... Let's give you some advice. Only understand the basic python syntax. I have read the foudation of python web programming's web part, and I feel nothing to gain. Wsgi is reading but does not understand it .. I don't know where to start... Let's give you some advice. Reply content: We recommend Flask Web Development. git tags are available in each section step by step to facilitate code reading.
Do not pay too much attention to details, such as the wsgi you mentioned, first overall, and then details. if you are confused, you need to go to the source code to find the answer.
To learn more, you need to read the source code and understand the principles of flask. For example, the principle of context, request, and session; how to add a template filter and how to inject the method; the db session of flask_sqlalchemy is also built on the context. the detailed principle of flask_cache is as follows, memoize how to clear the cache of the instance method through the class method; jinja2 filter. are filters in py familiar, bccache useful to you, and a deep understanding of template principles.
How to increase system throughput when encountering a blocking request, such as calling an external api, and how to implement a persistent connection (Comet) using flask )... (With the help of gevent, you will find that tornado has the most advantageous advantages)
In fact, a simple framework is limited, and the difficulty lies in how to work better and more efficiently with other components. 1. at least understand the network. The http layer must understand
2. familiar with python. this is a process, learning and practice.
3. learn about the official documents. the most comprehensive and clear intention is the official documents.
4. write a demo. if you don't want to write more, see how others write.
5. study a certain point and go deep into the source code. sometimes the source code cannot be understood. you can ask other people.
I think it is difficult to understand the internal flask ).
1. config principles
2. routing principle
3. Wsgi interface call
4. understand session
5. understand threading. local
6. understand the thread local encapsulated by flask.
7. understand g and request
8. to understand app context and request context, you must first like pocoo. the pocoo documentation is very standard and clearly explained. We recommend that you directly read the original English text to learn Flask.
Then, answer the question.
I think the difficulty in learning Flask is not how to use Flask, but how to use Python and understand the Web framework. To understand how to use the Web framework to develop websites, Flask should be able to learn smoothly.
Some concepts need to be understood, such as the MVC development mode, Route definition, and HTTP Method.
Of course, Flask also has its own characteristics, such as the Blueprint and Testing sections. we recommend that you learn first.
After you have a basic understanding of the Flask framework, you can look at some Flask-based website source code on Github, such as June (pythoncn/June road GitHub
).
Finally, smart developers will not be on their own. The following Flask resources collected by a Python-China User:
Humiaozuzu/flask-dev-bookmarks Road GitHub
Https://github.com/humiaozuzu/flask-dev-bookmarks/blob/master/plugins.md
Learn flask at the same time. I used to take a Chinese tutorial. now I am going to give up ..
When I followed the tutorial, I encountered several problems:
1. I do not understand the basic knowledge of Web development, and I do not know what the Web framework should do.
2. Chinese document pitfalls! Step 2: Set the application code
Here, the link after step 2 is step 4 (the link error is found only after it is pitfall), and it cannot be run after it is finished. after comparing the English documents, it is found that some code is missing ..
I plan to follow the previous answer to understand the basic knowledge of the Web framework.
I just searched and recommended this article: [Translation] what is a web framework?
Learn flask, read this Tutorial The Flask Mega-Tutorial, Part III: Web Forms
Especially good flask? Is it hard to learn?
Wsgi can look at a lot of examples, such as this http://archimedeanco.com/wsgi-tutorial/
Flask itself is too simple to be simple, so if you find it difficult, it is obvious that you have not learned the basics well. we suggest you start from the basics, such as the basic knowledge of web development: session management, template, God code, and learning flask in a day ...... The following is an excerpt from my blog "Flask Getting Started Guide". I don't know if it will help you.
Flask Getting Started Guide
--------
Flask
It is very easy to get started with Flask. just read the quick start in the official Flask documentation.To implement a simple website. Of course, whether the website looks good or not depends on the html, CSS, and js levels, which is not within the scope of Flask.
Flask proficiency
To be proficient in Flask, quick start is not enough. how can we use Flask well? There are no special shortcuts to using Flask, but they still rely on "using more, thinking more, and looking at other people's excellent code 』, experience may be the most appropriate shortcut to grasp new technologies in the programming world, but the accumulation of experience is a long process, it relies on "multi-use, multi-thinking, and excellent code for others 』. Flask proficiency depends on your own efforts. excellent materials can be shared. I recommend some materials that I think are good.
(1) Flask official documentation
Flask official documentation is still quite well written, as there is no problem in learning Flask first-hand materials, and Flask official SnippetsIt is very helpful for development, and it also prevents developers from spending too much time thinking about how to develop duplicate wheels.
(2) Flask Web development
This book is quite good. through the study of this book, we can basically achieve the first-hand Flask learning materials from getting started to mastering Flask. The architecture of building a large project using Flask described in the book is very useful and practical.
(3) miguelgrinberg.com
The blog of the author of the above book is a good material that has accumulated Flask development experience.
(4) Write a Tumblelog Application with Flask and login engine
This is a tutorial in the official MongoDB document and a good case for studying Flask Development. it is especially suitable for the application scenarios of Flask + MongoDB development.
(5) Flask source code
Flask itself is a very good Python library. reading its source code is very helpful for understanding Flask and improving Python development.
(6) The Hitchhiker's Guide to Python!
Although this document is not directly related to Flask, it is of great learning value for beginners.
I would like to ask you this question. based on the above answers, I think to learn flask, first, I have to learn some web development knowledge, and then I want to be familiar with coding using python, finally, let's take a look at the flask document or the project source code. is that my understanding? At the same time, I also want to ask if you need to learn a part of the knowledge before learning flask, just as someone mentioned earlier, "basic web development knowledge: session management, template, and CAPTCHA ", can you elaborate on what this "essential knowledge" is? (Because I learned python programming first and want to transfer it to python for webpage development, I would like to ask what "basic knowledge" I want to learn. please help me !) We all know that 10 lines are required for a refined line.
For example, if you want to be proficient in Flask, you don't just need to study Flask all day long. you also need to understand HTML, CSS, JavaScript, python, and SQL. when your program is ready, you need to understand Linux for deployment, understand O & M.
Therefore, we recommend that you not only learn flask, but also focus on the "essence" of the Web front-end backend. flask is only a technique, while the latter is. Read the official documents directly and write them clearly;
Watch The Flask Mega and get started soon. There are translations in open source China.
Take a look at flask-related projects on github.