The file structure is at the bottom:
[FILE STRUCTURE][1]
The error is:
jinja2.exceptions.TemplateNotFound
jinja2.exceptions.TemplateNotFound: entry.html
The full error is:
[jinja 2 full error][2]
All files are working except the /entry file (Examine the flask_app code below)
**I am using python version 3 and flask to make a website.I have also imported jinja 2 **
**WARNING: DO NOT COPY PASTE ALL CODE IN ONE FILE.There are different files here.
All files code is given to you
import search4letters
app = Flask(__name__)
@app.route('/search4')
def do_search() -> 'html':
return str(search4letters('life, the universe, and everything!', 'eiru,!'))
@app.route('/')
@app.route('/entry')
def entry_page() -> 'html':
return render_template('entry.html', the_title = "Welcome to search4letters on the web!")
app.run(debug=True)
**The entry.html file code is here: **
{% extends 'base.html' %}
{% block body %}
<h2>{{ the_title }}</h2>
<form method='POST' action='/search4'>
<table>
<p>Use this form to submit a search request:</p>
<tr><td>Phrase:</td><td><input name='phrase' type='TEXT'
width='60'></td></tr>
<tr><td>Letters:</td><td><input name='letters' type='TEXT'
value='aeiou'></td></tr>
</table>
<p>When you're ready, click this button:</p>
<p><input value='Do it!' type='SUBMIT'></p>
</form>
{% endblock %}
###The base.html file code is here: ###
<!doctype html>
<html>
<head>
<title>{{ the_title }}</title>
<link rel="stylesheet" href="static/hf.css" />
</head>
<body>
{% block body %}
{% endblock %}
</body>
</html>
**I have made the static folder. Inside it is the hf.css file. hf.css file code is given here: **
body {
font-family: Verdana, Geneva, Arial, sans-serif;
font-size: medium;
background-color: grey;
/* background-color: tan; */
margin-top: 5%;
margin-bottom: 5%;
margin-left: 10%;
margin-right: 10%;
border: 1px dotted gray;
padding: 10px 10px 10px 10px;
}
a {
text-decoration: none;
font-weight: 600;
}
a:hover {
text-decoration: underline;
}
a img {
border: 0;
}
h2 {
font-size: 150%;
}
table {
margin-left: 20px;
margin-right: 20px;
caption-side: bottom;
border-collapse: collapse;
}
td, th {
padding: 5px;
text-align: left;
}
.copyright {
font-size: 75%;
font-style: italic;
}
.slogan {
font-size: 75%;
font-style: italic;
}
.confirmentry {
font-weight: 600;
}
/*** Tables ***/
table {
font-size: 1em;
background-color: #fafcff;
border: 1px solid #909090;
color: #2a2a2a;
padding: 5px 5px 2px;
border-collapse: collapse;
}
td, th {
border: thin dotted gray;
}
/*** Inputs ***/
input[type=text] {
font-size: 115%;
width: 30em;
}
input[type=submit] {
font-size: 125%;
}
select {
font-size: 125%;
}```
**Please help me resolve this problem.**
###results.html file code is given here - This file gives the results of to the user.###
{% extends 'base.html' %}
{% block body %}
<h2>{{ the_title }}</h2>
<p>You submitted the following data:</p>
<table>
<tr><td>Phrase:</td><td>{{ the_phrase }}</td></tr>
<tr><td>Letters:</td><td>{{ the_letters }}</td></tr>
</table>
<p>When "{{the_phrase }}" is search for "{{ the_letters }}", the following
results are returned:</p>
<h3>{{ the_results }}</h3>
{% endblock %}
[1]: https://i.stack.imgur.com/B38GN.png
[2]: https://i.stack.imgur.com/RIo1H.png