I have s small website, but the icon doesn't work properly: Here's the code:
base.html
<html>
<head>
<link rel="icon" href="static/icon.png" sizes="32x32">
<title>
{% block title %}{{title}}{% endblock %}
</title>
<link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div id="page_container">
{% block content %}
<div class="container-fluid" style="margin-top: 100px;">
{% with messages = get_flashed_messages() %}
{% if messages %}
{% for message in messages %}
<div class="alert alert-info" role="alert">{{message}}</div>
{% endfor %}
{% endif %}
{% endwith %}
{# application content needs to be provided in the app_content block #}
{% block app_content %}{% endblock %}
</div>
{% endblock %}
</div>
</body>
</html>
Browser shows the icon on this template:
about.html
{% extends "base.html" %}
{% block app_content %}
<div id="about_author_photo">
<img src="static/VVphoto.jpg" height="400px" width="270px">
</div>
{% endblock %}
but it doesn't on the one like this:
poems.html
{% extends "base.html" %}
{% block app_content %}
{% for poem in poems.items %}
{% include "_poem.html" %}
{% endfor %}
<div class="pagination-links">
{% for page in poems.iter_pages() %}
{% if page %}
{% if page != poems.page %}
<a href="{{ url_for('poems', page_num=page) }}">{{ page }}</a>
{% else %}
<span style="color: white;">({{ page }})</span>
{% endif %}
{% else %}
<span class=ellipsis style="color: white;">…</span>
{% endif %}
{% endfor %}
</div>
{% endblock %}
Here are the views for both of them:
@app.route('/')
@app.route('/about')
def about():
return render_template('about.html', title='З Гумором Про Все На Світі')
@app.route('/poems/<int:page_num>')
def poems(page_num):
poems = Poem.query.paginate(per_page=5, page=page_num, error_out=True)
return render_template('poems.html', title='Вірші', poems=poems)
i tried adding the icon to the poems tepmlate under {% extends "base.html %}
line but it did not work