hello.py
# start source block
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
	return 'Hello World!'
def main():
	#Dispositif de service Web pour le développement
	app.run(host='127.0.0.1', port=5678, debug=False)
if __name__ == '__main__':
	#Fonction principale fonction
	main()
# end source block
上面代码保存为hello.py Ligne d'instruction 运 ligne $ python hello.py Site touristique: http: // localhost: 5678 Affichage de surface normal Hello World!
hello/ --app.py --views/ ----__ init__.py # Stratégie ----view_hello.py --templates/ ----view_hello.html
app.py
# start source block
from flask import (
    Flask,
    Blueprint,
)
#Vue cible d'introduction
from views import view_hello
app = Flask(__name__)
#Remarque: les racines du visage de l'éléphant dans la ville_url/hello/Apparence
app.register_blueprint(view_hello.app, url_prefix='/hello')
def main():
    #Dispositif de service Web pour le développement
    app.run(host='127.0.0.1', port=5678, debug=False)
if __name__ == '__main__':
    #Fonction principale fonction
    main()
# end source block
view_hello.py
# start source block
from flask import (
    Flask,
    Blueprint,
    render_template,
)
app = Blueprint(
    'views.hello',
    __name__,
    template_folder='templates',
)
@app.route('/sayhello')
def say_hello():
    page_title = 'hello world'
    page_html = 'view_hello.html'
    res = {
        'page_title': page_title,
        # 'data_lst': data_lst,Autres numéros d'affichage
    }
    return render_template(
        page_html,
        res=res,
    )
# end source block
__init__.py
# start source block
# package
#Remarque
# end source block
view_hello.html
<!DOCTYPE html>
<html lang="ja">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>{{res.page_title}}</title>
  </head>
  <body >
Le monde de la chance!
  </body>
</html>
Ligne d'instruction 运 ligne $ python app.py Site touristique: http: // localhost: 5678 / hello / sayhello Affichage de surface normal Thème: bonjour le monde! 页 Contenu de la surface: 你好 Monde!