如何让firefox显示烧瓶网站的最新版本?

时间:2016-10-24 12:27:36

标签: firefox flask web-deployment

我正在为一些项目使用一个小型Web服务器,我使用经典的html-css-javascript组合,使用Flask python服务器。

我经常更改项目的每个部分,每次都保存它们。 然而,经常发生在查看网站时显示的内容对应于项目的旧版本 例如,如果我运行以下Python脚本:

#!/usr/bin/python3
# -*- coding: utf-8 -*-

from flask import Flask, render_template, url_for, request
app = Flask(__name__)

@app.route("/", methods=['GET', 'POST'])
def index():
    return render_template('indexfake.html')

if __name__ == "__main__":
    app.run(host= '0.0.0.0', port=5001)

其中" indexfake.html"不存在,然后转到http://localhost:5001/,Firefox会显示一个正常页面,与我通常使用的页面相对应。

如果我创建templates / indexfake.html(例如:)

<!DOCTYPE html>
{% extends "layout.html" %}
{% block body %}
<body><p>a</p>
    <script>
console.log('smthng');
    </script>
</body>
{% endblock %}

正确执行JS部分(仅当旧版本具有<script>部分时),但html仍然对应于旧版本。但是,如果我复制旧版本模式但稍微修改它,则修改将显示在导航器中

我尝试手动清理缓存(我正在使用Firefox),但它并没有改变任何东西。我试图停止并重新运行服务器,同样是非结果。

这个错误不一致,通常会在一个小时之后结束,但目前我正在经历超过24小时的错误。

有人知道发生了什么以及如何解决它吗?

作为补充,这是我使用的封装模板:

<!DOCTYPE html>
<html lang="en">
<title>Cool App</title>
<div class=page>
    <head>
        <meta charset="UTF-8" />
        <meta content="utf-8" http-equiv="encoding" />
        <title>D3 Test</title>
        <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
        <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css') }}" />
    </head>
    {% block body %}{% endblock %}
</div>
</html>

This question似乎相似,但答案(重新安装Flask和Werkzeug套件)对我没有用。

0 个答案:

没有答案
相关问题