【发布时间】:2011-09-26 01:35:51
【问题描述】:
我正在学习使用 Google App Engine 进行开发。
这是教程中的代码之一,http://code.google.com/appengine/docs/python/gettingstarted/usingwebapp.html
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
class MainPage(webapp.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write('Hello, webapp World!')
application = webapp.WSGIApplication(
[('/', MainPage)],
debug=True)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()
我的代码几乎相同。我有时会收到警告:
WARNING 2011-06-30 13:10:44,443 init.py:851] 您正在使用默认的 Django 版本 (0.96)。默认 Django 版本将在不久的将来在 App Engine 版本中更改。请调用 use_library() 显式选择 Django 版本。欲了解更多信息,请参阅http://code.google.com/appengine/docs/python/tools/libraries.html#Django
任何人都可以使用 use_library() 重构上述代码吗?我不确定如何开始以及在哪里使用 use_library 以及如何使用 webapp。
提前致谢。
【问题讨论】: