flask Framework Quick Start
Project to build a simple flask
- The first to use Pycharm create flask project
- Run flask project
1. Pycharm project to build a flask
(If the map does not appear Pycharm new project shown, you should upgrade to the latest version Pycharm)
2. Start project
from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello World!' if __name__ == '__main__': app.run()
Run app.run () simple flask project ran up, very simple
== rear end projects and logic interface is preferably separate ==
flask project design as much as possible as follows:
4. Important Note
1. Getting started is really easy, now visit http://127.0.0.1:5000/ , you will see the Hello World, it represents a successful start.
2. Should closed, you can use Ctrl + C shut down the server, the end of the run