【发布时间】:2014-02-02 10:55:40
【问题描述】:
我创建了一个网站,我暂时在应用引擎中托管。当我在计算机上打开 HTML 文件时,我可以浏览页面。只有当我前往 http://www.alshafarconstruction.appspot.com/index.html 时它才会失败。
错误信息:
Error: Not Found
The requested URL /contact.html was not found on this server
app.yaml:
application: alshafarnew
version: 1
runtime: python
api_version: 1
handlers:
- url: /(.*\.(gif|png|jpg|ico|js|css|swf|xml))
static_files: \1
upload: (.*\.(gif|png|jpg|ico|js|css|swf|xml))
- url: /(.*\.html)
static_files: \1
upload: index.html
- url: /.*
script: main.py
main.py:
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
class IndexHandler(webapp.RequestHandler):
def get(self):
if self.request.url.endswith('/'):
path = '%sindex.html'%self.request.url
self.redirect(path)
def post(self):
self.get()
application = webapp.WSGIApplication([('/.*', IndexHandler)], debug=True)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()
我检查了仪表板,发现 HTML 文件在那里。我是网站部署和设计的新手。任何人都可以提出可能的错误吗?我已经访问了许多网站以寻求解决方案。
【问题讨论】:
-
在仪表板中,是否有
contact.html页面的预览链接?如果你点击它,你会得到什么URL? -
粘贴你的 app.yaml 可能是个好主意,因为它可以管理路由等。
-
@PaulCollingwood 已将其发布为我的问题的更新
-
@NickR Iam 能够打开仪表板,但你能告诉我在哪里可以获得详细信息
-
你缺少的东西。在您的 app.yaml 中,您的处理程序应该已经处理了 index.html 的任何页面。你上传了应用程序吗?
标签: python html google-app-engine web web-deployment