Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

html com imagem no flask

tenho um html com uma imagem, ela carrega normalmente mas no flask ele da o erro 404 na hora de carregar a imagem Lembrando que eu coloquei a imagem na pasta template (é a pasta que está o meu html)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>qualquer</title>
</head>
<body>
    <img id="python" src="python.jpg">
</body>
</html>
1 resposta
solução!

Cristiano,

Crie a pasta static e dentro dela coloquei a pasta img na seguinte estrutura:

.
├── app
│   ├── static
│   │   ├── css
│   │   ├── img
│   │   │   └── python.jpg
│   │   └── js
│   ├── templates
│   │   └── index.html
│   ├── routes.py
│   └── README.md

no seu arquivo: index.html, fica deste jeito:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>qualquer</title>
</head>
<body>
    <img id="python" src="../static/img/python.jpg">
</body>
</html>

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software