【发布时间】:2010-10-02 03:46:32
【问题描述】:
app.yaml
application: classscheduler9000
version: 1
runtime: python
api_version: 1
handlers:
- url: /static
static_dir: static
- url: /images
static_dir: static/images
- url: /stylesheets
static_dir: static/stylesheets
- url: /users\.html
script: main.py
- url: /.*
script: login.py
main.py
import hashlib
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext import db
class AccountHolder(db.Model):
...
class MainPage(webapp.RequestHandler):
def get(self):
...
class UserWrite(webapp.RequestHandler):
def post(self):
...
application = webapp.WSGIApplication(
[('/', MainPage),
('/sign', UserWrite)],
debug=True)
def getMD5Hash(textToHash=None):
return hashlib.md5(textToHash).hexdigest()
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()
我目前正在使用 Google App Engine 进行离线测试。当我转到 localhost:8080 时,它会将我带到我的登录页面。但是,当我尝试访问 localhost:8080/users.html 时,它不会加载我的 main.py 文件(它会像断开的链接一样出错)。如果我交换 url,main.py 可以工作,但 login.py 不会加载。
我知道这可能是我的一些愚蠢的疏忽,我在谷歌或这个网站上找不到任何帮助。感谢您的帮助。
【问题讨论】:
-
错误日志中显示什么错误?发布您的 main.py 应用程序定义。
-
没有错误日志。一定是语义错误。
标签: python google-app-engine yaml