Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/297.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 访问window.open的静态文件在appengine 1.6.3中不再有效_Python_Google App Engine_Http Status Code 404_Window.open - Fatal编程技术网

Python 访问window.open的静态文件在appengine 1.6.3中不再有效

Python 访问window.open的静态文件在appengine 1.6.3中不再有效,python,google-app-engine,http-status-code-404,window.open,Python,Google App Engine,Http Status Code 404,Window.open,在我下载新版本之前,它一直在工作。现在我得到一个404错误 app.yamp是: application: gamekicks version: 1 runtime: python27 api_version: 1 threadsafe: true libraries: - name: PIL version: latest - name: webapp2 version: latest - name: webob version: latest - name: jinja2

在我下载新版本之前,它一直在工作。现在我得到一个404错误

app.yamp是:

application: gamekicks
version: 1
runtime: python27
api_version: 1
threadsafe: true

libraries:
- name: PIL
  version: latest
- name: webapp2
  version: latest
- name: webob
  version: latest  
- name: jinja2
  version: latest  

handlers:
- url: /stylesheets
  static_dir: static/stylesheets
- url: /images
  static_dir: static/images
- url: /js
  static_dir: static/js
- url: /templates
  static_dir: /templates  
- url: /.*
  script: gamekicks.app  
不再工作的javascript代码:

<input type="button" value="Chat" 
       onClick="window.open('chatmain.html','chatwindow','width=400,height=200')"> 


部署应用程序后,我不得不将模板目录从static/下移出,以解决jinja2路径无法正常工作的问题。它在当地运作良好。你知道为什么这不起作用吗?所有其他静态文件都被正确访问。

我解决了自己的问题。我将目录结构恢复到/static/templates以进行本地测试-问题已在本地解决。然后我再次部署,并在加载模板时出错。仔细考虑后,我意识到我正在将jinja路径设置为“static/template”-而它应该是简单的“template”,因为app.yaml正在以模板的形式访问html文件。所以,一个noob错误。我刚改变了jinja的路线,现在一切正常。希望这能帮助其他人开始使用python和jinja。

chatmain.html存储在哪里,浏览器尝试获取它的绝对URL是什么?通常,模板永远不应该是静态的,实际的静态HTML页面应该位于与模板不同的目录中,并由它们自己的处理程序提供服务。