forked from microsoft/python-sample-vscode-flask-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
13 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
from datetime import datetime | ||
from flask import Flask, render_template | ||
from hello_app import app | ||
from . import app | ||
|
||
@app.route('/') | ||
@app.route("/") | ||
def home(): | ||
return render_template("home.html") | ||
|
||
@app.route('/about') | ||
@app.route("/about") | ||
def about(): | ||
return render_template("about.html") | ||
|
||
@app.route('/contact') | ||
@app.route("/contact") | ||
def contact(): | ||
return render_template("contact.html") | ||
|
||
@app.route('/hello/<name>') | ||
@app.route("/hello/<name>") | ||
def hello_there(name): | ||
return render_template( | ||
"hello_there.html", | ||
name=name, | ||
date=datetime.now() | ||
) | ||
|
||
@app.route('/api/data') | ||
@app.route("/api/data") | ||
def get_data(): | ||
return app.send_static_file('data.json') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
"""Entry point for the application.""" | ||
from . import app # For application discovery by the 'flask' command. | ||
from . import views # For import side-effects of setting up routes. | ||
|
||
# Time-saver: output a URL to the VS Code terminal so you can easily Ctrl+click to open a browser | ||
# print('http://127.0.0.1:5000/hello/VSCode') |