Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/go/7.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/15.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
Google app engine 在beegae中使用CSS_Google App Engine_Go_Beego - Fatal编程技术网

Google app engine 在beegae中使用CSS

Google app engine 在beegae中使用CSS,google-app-engine,go,beego,Google App Engine,Go,Beego,我正在使用Beegae软件包和Google Cloud SDK。我的项目可以运行,但访问CSS文件时遇到问题。它位于项目根目录的static\css中(我使用Windows)。我尝试设置StaticPath,将DirectoryIndex设置为true,并直接设置静态路径。我的html是 <link rel="stylesheet" href="/static/css/style.css" type="text/css" /> 如果有人能解释一下这个问题,我将不胜感激。我通过更改a

我正在使用Beegae软件包和Google Cloud SDK。我的项目可以运行,但访问CSS文件时遇到问题。它位于项目根目录的static\css中(我使用Windows)。我尝试设置StaticPath,将DirectoryIndex设置为true,并直接设置静态路径。我的html是

<link rel="stylesheet" href="/static/css/style.css" type="text/css" />

如果有人能解释一下这个问题,我将不胜感激。

我通过更改app.yaml解决了这个问题。我在“处理程序”部分添加了以下行:


我建议对任何在使用谷歌应用程序引擎时遇到静态文件问题的人进行类似的修改。

Ross Albertson的回答对我不起作用。这是我解决这个问题的办法。按如下所示更改app.yaml文件的处理程序部分

handlers:               

- url: /static          
  static_dir: ../static 

- url: /.*              
  script: _go_app       
这不仅对css很有帮助,而且对js、图像等其他文件也很有帮助

- url: /static/css
  static_dir: static/css
  mime_type: "text/css"
handlers:               

- url: /static          
  static_dir: ../static 

- url: /.*              
  script: _go_app