Please help, I have provided below three files: application.py, ask.html, and link.html. In ask.html, I'm trying to ask the user to provide me a link. They will then be redirected to link.html where there is a button to take them to that link. But once the button is pressed, it doesn't take me to the link, comes out error 404 not found.
In application.py:
@app.route("/")
def ask():
return render_template("ask.html")
@app.route("/link")
def link():
weblink = request.args.get("weblink")
return render_template("link.html", weblink=weblink)
In ask.html:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Ask</title>
</head>
<body>
<form action="/link">
<input placeholder="weblink here" name="weblink" type="text">
<input type="submit">
</form>
</body>
</html>
In link.html:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Ask</title>
</head>
<body>
<a href="{{ weblink }}" class="btn btn-primary">Go to Link</a>
</body>
</html>