File tree 4 files changed +13
-12
lines changed
4 files changed +13
-12
lines changed Original file line number Diff line number Diff line change 64
64
"request" : " launch" ,
65
65
"module" : " flask" ,
66
66
"env" : {
67
- "FLASK_APP" : " hello_app/app.py "
67
+ "FLASK_APP" : " hello_app.webapp "
68
68
},
69
69
"args" : [
70
70
" run" ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
from datetime import datetime
2
2
from flask import Flask , render_template
3
- from hello_app import app
3
+ from . import app
4
4
5
- @app .route ('/' )
5
+ @app .route ("/" )
6
6
def home ():
7
7
return render_template ("home.html" )
8
8
9
- @app .route (' /about' )
9
+ @app .route (" /about" )
10
10
def about ():
11
11
return render_template ("about.html" )
12
12
13
- @app .route (' /contact' )
13
+ @app .route (" /contact" )
14
14
def contact ():
15
15
return render_template ("contact.html" )
16
16
17
- @app .route (' /hello/<name>' )
17
+ @app .route (" /hello/<name>" )
18
18
def hello_there (name ):
19
19
return render_template (
20
20
"hello_there.html" ,
21
21
name = name ,
22
22
date = datetime .now ()
23
23
)
24
24
25
- @app .route (' /api/data' )
25
+ @app .route (" /api/data" )
26
26
def get_data ():
27
27
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