diff --git a/templates/not_found.html b/templates/not_found.html new file mode 100644 index 0000000..76c233c --- /dev/null +++ b/templates/not_found.html @@ -0,0 +1,10 @@ +{% extends "main.html" %} +{% block title %}Not Found{% endblock %} +{% block content %} +

Not Found

+ +Object not found +
+ +Home +{% endblock %} diff --git a/werbinich.py b/werbinich.py index c1b470b..52ad2b6 100644 --- a/werbinich.py +++ b/werbinich.py @@ -1,9 +1,9 @@ #!/usr/bin/python3 -from flask import Flask,render_template,request,url_for,redirect +from flask import Flask, render_template, request, url_for, redirect from pprint import pprint from uuid import uuid4 -app = Flask(__name__) +app = Flask(__name__) games = {} @app.route("/") @@ -20,7 +20,7 @@ def create_game(): mapping[player] = None games[gameid] = mapping - return redirect(url_for("player_select", gameid=gameid),303) + return redirect(url_for("player_select", gameid=gameid), 303) @app.route("/game//") def player_select(gameid): @@ -45,9 +45,9 @@ def store_name(gameid, player): @app.route("/game//show/") def name_show(gameid, player): other_players = dict(games[str(gameid)]) - other_players.pop(player,None) + other_players.pop(player, None) return render_template("name_show.html", current_player=player, other_players=other_players, edit_url=url_for("name_edit", gameid=gameid, player=player)) @app.errorhandler(KeyError) def not_found(error): - return "

Not Found

Object not found
home".format(url_for("create_game")), 404 + return render_template("not_found.html"), 404