Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/286.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 某些更改仅在本地显示,而不在heroku托管的Web应用程序上显示?_Python_Heroku_Flask - Fatal编程技术网

Python 某些更改仅在本地显示,而不在heroku托管的Web应用程序上显示?

Python 某些更改仅在本地显示,而不在heroku托管的Web应用程序上显示?,python,heroku,flask,Python,Heroku,Flask,我用html更改了标题并添加了一个favicon,这些更改只在本地显示。即使我更新了一些文本(“测试1 2 3”,如图所示),也会发生这种情况: 但是,当我更新到github并推送到heroku时,我发现文本发生了变化(“测试1 2 3”),但标题和favicon没有显示: 我也在使用隐姓埋名,所以缓存不会有问题,我在Firefox上也有同样的问题,所以它不能是浏览器。有什么问题吗 以下是我的html代码的一部分: <html> <link rel="shortcu

我用html更改了标题并添加了一个favicon,这些更改只在本地显示。即使我更新了一些文本(“测试1 2 3”,如图所示),也会发生这种情况:

但是,当我更新到github并推送到heroku时,我发现文本发生了变化(“测试1 2 3”),但标题和favicon没有显示:

我也在使用隐姓埋名,所以缓存不会有问题,我在Firefox上也有同样的问题,所以它不能是浏览器。有什么问题吗

以下是我的html代码的一部分:

  <html>
  <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
    <head>
         <title>
            Opal Kale
         </title>
        <meta name="description" content="Senior at Cal studying CS. Welcome to my personal homepage.">
        <meta name="keywords" content="Opal Kale">
        <link href='{{url_for('static', filename='style.css')}}' rel='stylesheet' type='text/css' />
        <link href='http://fonts.googleapis.com/css?family=Codystar:300,400' rel='stylesheet' type='text/css'>
    </head>
    <body id='home'>

蛋白石甘蓝

站点上的源代码表明html正文呈现在指向heroku服务器的标记中。因此,正在渲染正确的主体。但是正在呈现的标题是上的标题

您编写的标题和标题将在框架中的标记中呈现,但外部没有标题或标题标记,而浏览器正在读取该标记


我不确定这可能是什么原因造成的,但你的DNS/主机设置可能是罪魁祸首

进一步说明Kapil所说的,这根本不是代码的问题,而是域主机的问题。您在一家公司注册了域,但Heroku应用程序在另一个域上运行

您正在使用将URL指向Heroku。这意味着您的域注册器没有进行任何DNS更改,只是创建了一个页面,其中包含一个框架,显示其他url的内容

如果将页面卷曲,则可以看到:

>> curl http://www.opalkale.com/ 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<meta http-equiv='content-type' content='text/html; charset=UTF-8'>
<meta name="VERSION" content="">
<meta name="DATA" content="fwdnode7-bl.web-hosting.com (162.255.119.4)">
<title></title>
</head>
<frameset rows='100%, *' frameborder=no framespacing=0 border=0>
<frame src="http://glacial-mesa-9513.herokuapp.com/" name=mainwindow frameborder=no framespacing=0 marginheight=0 marginwidth=0></frame>
</frameset>
<noframes><h2>Your browser does not support frames. We recommend upgrading your browser.</h2><br><br>
<center>Click <a href="http://glacial-mesa-9513.herokuapp.com/" >here</a> to enter the site.</center>
</noframes>
</html>
卷曲http://www.opalkale.com/ 您的浏览器不支持框架。我们建议您升级浏览器。

单击以进入站点。 这种方法是有效的,但它确实是一种廉价而肮脏的方法。您的注册人不知道另一页的内容是什么,因此标题、favicon和其他任何内容都无法正确显示

正确的方法是让你的域名注册器注册,但是很多免费的域名注册器不会这样做