Skip to content

Commit 65f94fa

Browse files
committed
Add favicon.
1 parent cba7acc commit 65f94fa

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

Diff for: app.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from datetime import datetime
2-
from flask import Flask, render_template, request, redirect, url_for
2+
from flask import Flask, render_template, request, redirect, url_for, send_from_directory
33
app = Flask(__name__)
44

55

@@ -8,6 +8,10 @@ def index():
88
print('Request for index page received')
99
return render_template('index.html')
1010

11+
@app.route('/favicon.ico')
12+
def favicon():
13+
return send_from_directory(os.path.join(app.root_path, 'static'),
14+
'favicon.ico', mimetype='image/vnd.microsoft.icon')
1115

1216
@app.route('/hello', methods=['POST'])
1317
def hello():

Diff for: static/favicon.ico

15 KB
Binary file not shown.

Diff for: templates/hello.html

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<head>
33
<title>Hello Azure - Python Quickstart</title>
44
<link rel="stylesheet" href="{{ url_for('static', filename='bootstrap/css/bootstrap.min.css') }}">
5+
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
56
</head>
67
<html>
78
<body>

Diff for: templates/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<head>
33
<title>Hello Azure - Python Quickstart</title>
44
<link rel="stylesheet" href="{{ url_for('static', filename='bootstrap/css/bootstrap.min.css') }}">
5+
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
56
</head>
67
<html>
78
<body>

0 commit comments

Comments
 (0)