Ask coding questions

← Back to all posts
Why is the file showing as 404
MikeW3

I have a flask program that I'm working on but when the program serves the html file, the html file's resources, the scripts and stylesheets, are 404, even though I've tried multiple methods to make sure my url couldn't possibly be wrong and unless I'm dreaming, I am very sure I have created those files.

Answered by Saml2020 [earned 5 cycles]
View Answer
Voters
MikeW3
Comments
hotnewtop
Saml2020

Try putting resources like Scripts/Styles/Images in a subfolder called static. Flask will host anything in that folder as https://example.com/static/....

MikeW3

@Saml2020 Thanks a lot