python - SimpleHTTPServer 404 消息找不到文件(尝试加载 bootstrap.js)

标签 python twitter-bootstrap simplehttpserver

有人可以解释一下为什么我会收到以下错误吗?

从以下目录中,我正在运行“python -m SimpleHTTPServer”

[blah@blah:~/Dropbox/bootstrap]: ls
css     img     index.html  js

当我在浏览器中访问 localhost:8000/时,出现以下错误:

127.0.0.1 - - [16/May/2014 10:22:37] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [16/May/2014 10:22:37] code 404, message File not found
127.0.0.1 - - [16/May/2014 10:22:37] "GET /%E2%80%9Djs/bootstrap.js%E2%80%9D HTTP/1.1" 404 -

是的,在 js 目录中,我有两个文件“bootstrap.js”和“bootstrap.min.js”

我的index.html 文件如下所示:

<!DOCTYPE html>

<html>

    <head>
        <meta charset="utf-8">
        <title>My First Bootstrap Project</title>


    </head>

    <body>
        <div class="container">

            <h1><a href="#">Bootstrap Site</a></h1>
        </div>


        <link rel=”stylesheet” href=”css/bootstrap.css”  type=”text/css”/>
        <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
        <script src=”js/bootstrap.js”></script>
    </body>

</html>

最佳答案

我认为您的问题可能与您在 HTML 中使用的弯引号(智能引号)有关。相反,请使用常规引号:

regular: "
curly (smart): ”

关于python - SimpleHTTPServer 404 消息找不到文件(尝试加载 bootstrap.js),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23701173/

相关文章:

twitter-bootstrap - 在 tmpl 文件中使用 bootstrap 显示导航栏

html - 以响应方式在图像上垂直和水平对齐内容 DIV 的最佳方法是什么

python - 如何在 SimpleHTTPServer 中写入消息

python - Python 中长期串行连接出现 IO 错误 [Errno 5]

python - Numpy genfromtxt 遍历列

javascript - 为什么单击 tab2 时总是出现 tab1 的内容?

python - 如何将 SimpleHTTPServer 代码更改为等效的生产服务器

Python SimpleHTTPServer接收文件

python - 参数类型 -> 返回类型

python - 是否有必要传达(或预期)Python Socket TCP Buff 大小