Skip to content

Commit 36cf175

Browse files
Handle favicon with Flask.
1 parent a77b7ca commit 36cf175

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

learnpython/app.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@
88
from learnpython import settings
99

1010

11+
# Initialize Flask application
1112
app = Flask('learnpython')
1213
app.config.from_object(settings)
1314

15+
# Configure all necessary plugins
1416
babel = Babel(app)
1517
mail = Mail(app)
1618
manager = Manager(app)
1719
pages = FlatPages(app)
1820

21+
# Register all possible urls
1922
views = LazyViews(app, '.views')
2023
views.add('/', redirect, defaults={'code': 301, 'location': '/index'})
2124
views.add('/<any(about, index):name>', 'page')
@@ -27,3 +30,4 @@
2730
defaults={'name': 'subscribe'},
2831
endpoint='subscribe',
2932
methods=('GET', 'POST'))
33+
views.add_static('/favicon.ico', defaults={'filename': 'img/favicon.ico'})

0 commit comments

Comments
 (0)