0

I'm working on my final project which is a web app using Flask. Right now I'm just trying to lay down the html but all of my linked external stylesheets, js files and local images are producing 404 not found errors. For example, in my index.html file I have the following:

<!doctype html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="CS50 final project: AisleMate Web App">
    <meta name="author" content="">

    <title>AisleMate</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link href='http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Arvo:400,700' rel='stylesheet' type='text/css'>
    <!-- Custom CSS-->
    <link href="css/general.css" rel="stylesheet">

etc... However none of the stylesheets are found. All questions i've seen on this topic reference incorrect links however this is my app folder structure and the relevant file locations:

├── css
│    ├──bootstrap.min.css
│    └── general.css
├── font-awesome
│    ├──css
│    ├──fonts
│    ├──less
│    └── scss
├── fonts
│   └── lato
├── img
│    ├──icon
│    ├──intro
│    └── slide
├── js
├── templates
│    └── index.html
└── app.py
7
  • is that your index.html? if so, it appears to be inside templates. values of href in this case are relative paths. for example, css/bootstrap.min.css refers to templates/css/bootstrap.min.css. I suppose something like ../css/bootstrap.min.css should work in this case, but probably you should try using absolute paths to avoid confusion!
    – kzidane
    Commented Mar 27, 2016 at 15:17
  • @Kareem I have tried both of those options. the .. relative path didn't have an effect and the absolute path gave an error that it can't load local resources.
    – minniebot
    Commented Mar 27, 2016 at 15:21
  • what about your permissions?
    – kzidane
    Commented Mar 27, 2016 at 15:29
  • how do i check/change them?
    – minniebot
    Commented Mar 27, 2016 at 15:30
  • with ls -la and chmod respectively.
    – kzidane
    Commented Mar 27, 2016 at 15:30

0

You must log in to answer this question.

Browse other questions tagged .