将静态项目上传到Google应用引擎 [英] Uploading a static project to google app engines

查看:260
本文介绍了将静态项目上传到Google应用引擎的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

免责声明:我已经在此处提问,但显然与主题无关。



我想使用引导程序模板设置页面,并将其作为静态使用google appengine服务的网站。



在google_appengine目录中,我使用页面数据和应用创建了一个文件夹 page 。 yaml


  • google_appengine [文件夹]


    • ...

    • dev_appserver.py

    • appcfg.py

    • ...


    • $ b

      • app.yaml

      • 公共[文件夹]





app.yaml将此列为内容:

 应用程序:coolmoon 
版本:1
运行时:python27
api_version:1
线程安全:是

处理程序:

- url:/(.+)
static_files:public / \ 1
upload:public /(.*)
$ b $ - url:/
static_files:public / index.html
upload:public / index.html

skip_files:
- ^(。* /)?app \.yaml
- ^(。* /)?app \.yml
- ^(。* /)?#。*#
- ^(。* /)?。*〜
- ^ (。* /)?。* \.py [co]
- ^(。* /)?。* / RCS /.*
- ^(。* /)?\ .. *
- ^(。* /)?测试$
- ^(。* /)?test $
- ^ test /(.*/)?
- ^ COPYING.LESSER
- ^ README \ .. *
- \.gitignore
- ^ \.git /.*
- \ 。* \ .lint $
- ^ fabfile \.py
- ^ testrunner \.py
- ^ grunt \.js
- ^ node_modules /(。 * /)?

当我进入google_appengine文件夹时,我运行了

  python dev_appserver.py page 

我得到错误消息

pre $ code> Traceback(最近一次调用的最后一行):文件dev_appserver.py,第82行,
in <模块>文件/ home / bogus / webpage / google_appengine /
execfile(_PATHS.script_file(script_name),globals_)
_run_file(__ file__,globals() google / appengine / tools / devappserver2 / devappserver2.py,
line 943,位于< module>
main()文件/home/bogus/webpage/google_appengine/google/appengine/tools/devappserver2/devappserver2.py,
第936行,主
dev_server.start(选项)文件/home/bogus/webpage/google_appengine/google/appengine/tools/devappserver2/devappserver2.py,
line 695,in start
options.config_paths)File/ home / bogus / webpage / google_appengine / google / appengine / tools / devappserver2 / application_configuration.py,
line 617,in __init__
config_paths = self._config_files_from_paths(config_paths)文件/ home / bogus / webpage / google_appengine / google / appengine /tools/devappserver2/application_configuration.py,
第682行,在_config_files_from_paths中
self._config_files_from_dir(path)if os.path.isdir(path)else [path])File
/ home / bogus / webpage / google_appengine / google / appengine / tools / devappserver2 / application_configuration.py,
第710行,位于_config_files_from_dir
(dir_path,or_web_inf))google.appengine.tools .devappserver2.errors.AppConfigNotFoundError:
page /是一个目录,但不包含app.yaml或app.yml

但app.yaml肯定在文件夹页面



发生了什么问题?



我的命令是否正确?为什么不使用Amazon S3或类似的服务?它更适合这种事情。


Disclaimer: I already asked here, but apparently off-topic.

I want to set up a page using this bootstrap template and host it as a static website using the google appengine service.

Inside the google_appengine directory, I created a folder page with the page data and the app.yaml:

  • google_appengine [folder]
    • ...
    • dev_appserver.py
    • appcfg.py
    • ...
    • page [folder]
      • app.yaml
      • public [folder]

app.yaml has this as a content:

      application: coolmoon
  version: 1
  runtime: python27
  api_version: 1
  threadsafe: yes

  handlers:

  - url: /(.+)
    static_files: public/\1
    upload: public/(.*)

  - url: /
    static_files: public/index.html
    upload: public/index.html

  skip_files:
  - ^(.*/)?app\.yaml
  - ^(.*/)?app\.yml
  - ^(.*/)?#.*#
  - ^(.*/)?.*~
  - ^(.*/)?.*\.py[co]
  - ^(.*/)?.*/RCS/.*
  - ^(.*/)?\..*
  - ^(.*/)?tests$
  - ^(.*/)?test$
  - ^test/(.*/)?
  - ^COPYING.LESSER
  - ^README\..*
  - \.gitignore
  - ^\.git/.*
  - \.*\.lint$
  - ^fabfile\.py
  - ^testrunner\.py
  - ^grunt\.js
  - ^node_modules/(.*/)?

When I'm inside the google_appengine folder and I run

python dev_appserver.py page

I get the error message

 Traceback (most recent call last):   File "dev_appserver.py", line 82,
 in <module>
     _run_file(__file__, globals())   File "dev_appserver.py", line 78, in _run_file
     execfile(_PATHS.script_file(script_name), globals_)   File "/home/bogus/webpage/google_appengine/google/appengine/tools/devappserver2/devappserver2.py",
 line 943, in <module>
     main()   File "/home/bogus/webpage/google_appengine/google/appengine/tools/devappserver2/devappserver2.py",
 line 936, in main
     dev_server.start(options)   File "/home/bogus/webpage/google_appengine/google/appengine/tools/devappserver2/devappserver2.py",
 line 695, in start
     options.config_paths)   File "/home/bogus/webpage/google_appengine/google/appengine/tools/devappserver2/application_configuration.py",
 line 617, in __init__
     config_paths = self._config_files_from_paths(config_paths)   File "/home/bogus/webpage/google_appengine/google/appengine/tools/devappserver2/application_configuration.py",
 line 682, in _config_files_from_paths
     self._config_files_from_dir(path) if os.path.isdir(path) else [path])   File
 "/home/bogus/webpage/google_appengine/google/appengine/tools/devappserver2/application_configuration.py",
 line 710, in _config_files_from_dir
     (dir_path, or_web_inf)) google.appengine.tools.devappserver2.errors.AppConfigNotFoundError:
 "page/" is a directory but does not contain app.yaml or app.yml

but app.yaml is definitely inside the folder page

What is going wrong?

Is my command correct?

解决方案

Why not use Amazon S3 or a similar service? It is more geared towards this sort of thing.

这篇关于将静态项目上传到Google应用引擎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆