October 23, 2024
Chicago 12, Melborne City, USA
HTML

Failed to load resource: the server responded with a status of 404 (NOT FOUND) Flask application


I’m getting this error but my files do exist and I think my file structure is correct, I don’t know what to do due to I’ve tried everything I’ve found on the net but it’s still failing to load the css to my html base template.

This is my structure:

C:.
│   run.py
│   
├───instance
│       site.db
│       
├───jecco
│       models.py
│       routes.py
│       __init__.py
│
├───static
│       style.css
│
└───templates
        base.html

This is my base.html:

<!doctype html>
<html lang="es">
  <head>
      <!-- Required meta tags -->
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
      <link rel="stylesheet" href="{{ url_for('static', filename="style.css") }}">
      <title>MyProject</title>

  </head>
  <body>


      <header class="header">

        <div>
            <h1>Welcome</h1>
            <a href="{{ url_for('main.home')}}">Inicio</a>
            <a href="">Catalogo</a>
            <a href="">Rendimiento</a>
            <hr>
        </div>
 
      </header>

      <h1>Hello, world!</h1>

  </body>

This is my css file:

.header{
     background-color: blueviolet;
     display: grid;
     grid-template-columns: 1fr 2fr;
 }

I’ve tried moving my files to the same folders as the templates, with a styles folder instead of static and using relative and absolute paths.



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video