Aug-06-2020, 05:40 AM
Hi everyone,
I have a html page under template\about\index.html
Is it possible to display an image who is located in the same path -> template\about\img.jpg ??
Because I have an error ->
template\about\index.html is display on the "/" it's on purpose.
I created app.add_url_rule('/about', 'about', about) to try to solve the access problem but it's not helping.
I get a 404 error (not found) :/
I have a html page under template\about\index.html
Is it possible to display an image who is located in the same path -> template\about\img.jpg ??
Because I have an error ->
template\about\index.html is display on the "/" it's on purpose.
I created app.add_url_rule('/about', 'about', about) to try to solve the access problem but it's not helping.
from flask import Flask, render_template
app = Flask(__name__)
def index():
return render_template("about/index.html")
def about():
pass
app.add_url_rule('/', 'index', index)
app.add_url_rule('/about', 'about', about)index.html<!DOCTYPE html> <html lang="en"> <head> <title>About</title> </head> <body> This is our base template :) <BR> <img src="about/Joker.png"> </body> </html>When I point my browser to
http://192.168.80.11:5000/about/img.jpgI get a 404 error (not found) :/

to python-forum.io who is way more human !and where we can solve, express our ideas ! Big thanks !