Skip to content

Commit fd3d162

Browse files
committed
Add 404 page
1 parent 014a6cd commit fd3d162

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

‎pythoncz/static/images/404.png‎

49.3 KB
Loading

‎pythoncz/templates/404.html‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{% extends '_base.html' %}
2+
{% block head %}
3+
<title>Python - 404</title>
4+
{% endblock %}
5+
{% block content %}
6+
7+
<div class="logo">
8+
<h1>Stránka nenalezena.</h1>
9+
<h1>Page not found.</h1>
10+
<img alt="404" src="{{ url_for('static', filename='images/404.png') }}" />
11+
</div>
12+
13+
{% endblock %}

‎pythoncz/views.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ def render_template(filename, **kwargs):
1515
return _render_template(filename, **kwargs)
1616

1717

18+
@app.errorhandler(404)
19+
def page_not_found(e):
20+
return render_template('404.html'), 404
21+
22+
1823
@app.context_processor
1924
def inject_context():
2025
return {

0 commit comments

Comments
 (0)