Introduction to Flask
Like most popular open source projects, Flask has very good documentation, available at http://flask.pocoo.org/docs/0.10/. If any of the examples are unclear, you can be sure to find the answer on the project documentation.
Note
I would also highly recommend Miguel Grinberg's (https://blog.miguelgrinberg.com/) work related to Flask. His blog, book, and video training has taught me a lot about Flask. In fact, Miguel's class Building Web APIs with Flask inspired me to write this chapter. You can take a look at his published code on GitHub: https://github.com/miguelgrinberg/oreilly-flask-apis-video.
Our first Flask application is contained in one single file, namely chapter9_1.py
:
from flask import Flask app = Flask(__name__) @app.route('/') def hello_networkers(): return 'Hello Networkers!' if __name__ == '__main__': app.run(host='0.0.0.0', debug=True)
This will almost always be your design pattern for Flask initially. We create an instance of the Flask class with...