File tree Expand file tree Collapse file tree 4 files changed +13
-12
lines changed
Expand file tree Collapse file tree 4 files changed +13
-12
lines changed Original file line number Diff line number Diff line change 6464 "request" : " launch" ,
6565 "module" : " flask" ,
6666 "env" : {
67- "FLASK_APP" : " hello_app/app.py "
67+ "FLASK_APP" : " hello_app.webapp "
6868 },
6969 "args" : [
7070 " run" ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11from datetime import datetime
22from flask import Flask , render_template
3- from hello_app import app
3+ from . import app
44
5- @app .route ('/' )
5+ @app .route ("/" )
66def home ():
77 return render_template ("home.html" )
88
9- @app .route (' /about' )
9+ @app .route (" /about" )
1010def about ():
1111 return render_template ("about.html" )
1212
13- @app .route (' /contact' )
13+ @app .route (" /contact" )
1414def contact ():
1515 return render_template ("contact.html" )
1616
17- @app .route (' /hello/<name>' )
17+ @app .route (" /hello/<name>" )
1818def hello_there (name ):
1919 return render_template (
2020 "hello_there.html" ,
2121 name = name ,
2222 date = datetime .now ()
2323 )
2424
25- @app .route (' /api/data' )
25+ @app .route (" /api/data" )
2626def get_data ():
2727 return app .send_static_file ('data.json' )
Original file line number Diff line number Diff line change 1+ """Entry point for the application."""
2+ from . import app # For application discovery by the 'flask' command.
3+ from . import views # For import side-effects of setting up routes.
4+
5+ # Time-saver: output a URL to the VS Code terminal so you can easily Ctrl+click to open a browser
6+ # print('http://127.0.0.1:5000/hello/VSCode')
You can’t perform that action at this time.
0 commit comments