0

I am currently developing a web page in flask and have css file for it too. As flask requires the css to be stored in static folder. I've done it but I still am facing 404 error when it comes it css and also images. Here is my directory. Directory Structure. and here is my template.html file code

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="https://kit.fontawesome.com/cef2bxxxx.js"></script>
    <link rel="stylesheet" href="static/css/style.css">
    <title>About Me</title>
</head>
<body>
    <div class="box">
        <img src="static/images/profile.jpg", class="box-img"/>
        <h1>Raj</h1>
        <h5>Python Programmer</h5>
        <p>I am a newbie programmer studying Information Technology. I love programming and this is my first website using Python, HTML, CSS.</p>
        <ul>
            <li><a href="https://instagram.com"><i class="fab fa-instagram-square"></i></a></li>
        </ul>
    </div>
</body>
</html>
  • Could you please also provide your app setup? – simkusr Mar 16 '20 at 13:12
  • From the project structure, I can see that it's quite not appropriate (static directory should not be in the templates directory and also I can see that app.py is in the templates directory also), check out officially offered flask project setup https://flask.palletsprojects.com/en/1.1.x/tutorial/layout/. Hope this helps – simkusr Mar 16 '20 at 13:12

0 Answers0