Hi
Normal Flask code look like
--------------
--------------
If you need template page, your flask file should return the following code
return render_template('template.html', result=hupresult)
Your template.html should be saved inside templates folder
and the code template.html should look like
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flask Image Example</title>
</head>
<body>
<h1>{{ result }}</h1>
<!-- Display the image from the static folder -->
<img src="{{ url_for('static', filename='bg.jpg') }}" alt="Your Image">
</body>
</html>
The image bg.jpg should be saved inside 'static' folder
No comments:
Post a Comment