From 28b130c97b3b6fee06240ebf6d751fe0ba28ab15 Mon Sep 17 00:00:00 2001 From: Enow Date: Sat, 2 Dec 2023 15:46:38 +0100 Subject: [PATCH] implementation of user friendly error message --- app.py | 4 ++-- error_handling.py | 2 +- templates/input.html | 31 +++++++++++++++++++++++++++++-- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/app.py b/app.py index 246e44f..c73ac25 100644 --- a/app.py +++ b/app.py @@ -10,11 +10,11 @@ @app.route("/") def index(): - return redirect(url_for("input")) + return redirect(url_for("index.html")) @app.route("/input") def input(): - return render_template("index.html") + return render_template("input.html") #setting up backend to receive urls @app.route('/save_url', methods=['POST']) diff --git a/error_handling.py b/error_handling.py index d5b502b..3f4b9cc 100644 --- a/error_handling.py +++ b/error_handling.py @@ -1,5 +1,5 @@ - import csv +import csv import requests from requests.exceptions import RequestException import os diff --git a/templates/input.html b/templates/input.html index 723349f..6e1dd95 100755 --- a/templates/input.html +++ b/templates/input.html @@ -4,14 +4,41 @@ {% block content %}

Input Webpage URLs

-
+ -
+ {% endblock %} {% block title %} Input webpages URLs