Recommend a learning Python Web site, personally feel that there is a big harvest here, hope to learn flask later small partners to help. http://www.pythondoc.com/
Implementation of the first Web application with the Flask framework
first you need to figure out a few concepts:
1. View: A view is a processor that responds to requests from a Web browser. In Flask, the view is written as a Python function that implements functionality inside. Each view function is a URL that maps to one or more requests.
2. Applications: Used to create application objects, import views, etc.
3. Startup script: The script used to start the Web server, that is, run.py.
The above mentioned "concept" is actually a few steps to implement a Web application, just touch Web development Some things are not particularly clear, for the record here.
I put all the "apps" in the "Apps" folder, in the Flask directory.
Create views.py views and __init__.py initializers in the app folder, respectively.
views.py
from Import App@app.route ('/') @app. Route ('/index' ) )def index (): return"Hello, world! "
__init__.py
from Import = Flask (__name__)fromimport views
You can then start the Web server with run.py in scripts.
run.py
# !flask/bin/python from Import = True)
Finally run the run.py script, access to 127.0.0.1:5000 can see the implementation of the small program.
Flask Simple Web Application