2008-04-15

在GAE中生成全局序列号

关键字: gae python googleappengine
gae不能写文件,所以很多操作只能用datastore来实现了。 class Sequence(db.Model): @staticmethod def next(): seq = Sequence() seq.put() id = seq.key().id() seq.delete() return id 使用 print Sequence.next()
2008-04-15

Restful your google app engine applications

关键字: rest restful gae googleappengine python
使用示例: #author:pickerel@gmail.com import wsgiref.handlers from google.appengine.ext import webapp from rest import * class CommentResource(RestResource): def initialize(self): self.response.out.write("comment.initialize:format=%s<br/>" %(self.format)) def index(self, ...
2008-04-11

在GAE中使用django模板

关键字: gae googleappengine django
Google App Engine自带了django框架,开发者可以直接在上面使用django开始web程序,如果你不打算去学django框架,而只是想用它的模板机制,那也是可以的,这里以一个hello, world为例做个演示: 文件:./simple_blog/app.yaml application: simple-blog version: 1 runtime: python api_version: 1 handlers: - url: /.* script: simple_blog.py 文件:./simple_blog/simple_blog.py #!/usr/bin ...
2008-04-11

在GAE中读取yaml的例子

关键字: gae googleappengine yaml
在Google App Engine中内置了yaml文件的验证、解析方法,下面演示一个在GAE中读取yaml的例子 待读取的配置文件 config.yaml 内容如下: blog_name: 我们的博客 allow_comment: False masters: - name: Pickerel Yee account: pickerel@gmail.com - name: 王二 account: wang2@gmail.com 建立配置验证读取文件 config.py #!/usr/bin/env python # -*- coding: utf-8 -*- impor ...
2008-04-09

bug in gae:regex invalid: unbalanced parenthesis

关键字: googleappengine
在windows下运行一个示例工程的时候返回错误 regex invalid: unbalanced parenthesis 修正: 找到 google\appengine\tools\dev_appserver.py 文件,到2369行把以下两行代码 regex = os.path.join(re.escape(regex), '(.*)') path = os.path.join(path, '\\1') 修改为 regex = re.escape(regex) + '/(.*)' path = path + '/\\1' 在 ...
pickerel
搜索本博客
最近加入圈子
存档
最新评论