Ask coding questions

← Back to all posts
Image not founded 404
Yoplayer1py (6)

HI!;

I was making a app in flask/html but I got an error:
(shell)

Replit: Updating package configuration
 * Serving Flask app "main" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://0.0.0.0:8080/ (Press CTRL+C to quit)
172.18.0.1 - - [11/Jul/2021 05:52:20] "GET / HTTP/1.1" 200 -
172.18.0.1 - - [11/Jul/2021 05:52:21] "GET /img/pokebg.jpg HTTP/1.1" 404 -
172.18.0.1 - - [11/Jul/2021 05:52:25] "GET / HTTP/1.1" 200 -
172.18.0.1 - - [11/Jul/2021 05:52:26] "GET /img/pokebg.jpg HTTP/1.1" 404 -
172.18.0.1 - - [11/Jul/2021 05:52:49] "GET /img/pokebg.jpg HTTP/1.1" 404 -
172.18.0.1 - - [11/Jul/2021 05:53:04] "GET /templates/img/pokebg.jpg HTTP/1.1" 404 -

Here's the ss :

What I wanted to do was make the pokebg.jpg file an background image like from w3schools : https://www.w3schools.com/html/tryit.asp?filename=tryhtml_images_background5

Thank YOu in advance!!

Answered by ch1ck3n (2340) [earned 5 cycles]
View Answer
Comments
hotnewtop
ch1ck3n (2340)

put the image in /static/ from the root directory

and the url should be like /static/pokebg.jpg

ch1ck3n (2340)

@ch1ck3n

like that

no extra folders

if you want an /img/ folder do it just do it the same for the url