サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
体力トレーニング
appengine-cookbook.appspot.com
def autoretry_datastore_timeouts(attempts=5.0, interval=0.1, exponent=2.0): """ Copyright (C) 2009 twitter.com/rcb Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sub
application: appid version: 1 runtime: python api_version: 1 handlers: - url: .* script: main.py secure: optional - url: /_ah/mail/.+ script: main.py login: admin inbound_services: - mail #!/usr/bin/env python # -*- coding: latin-1 -*- import logging from google.appengine.ext import webapp from google.appengine.ext.webapp.mail_handlers import InboundMailHandler from google.appengine.ext.webapp.ut
Posted by arachnid@notdot.net on Sun 23 Aug 2009 in Datastore User ratings: The usual pattern used for counters that may have a high rate of updates is to use sharding. This scales well, but imposes higher overhead when fetching the counts, and requires using a third party library or implementing the details yourself. There is a simpler way to do high-concurrency counters when having an exact
Accept Google, AOL, Yahoo, MySpace, Facebook, and OpenID Logins RPX (http://rpxnow.com/) is a free service which authenticates users via OpenID and other protocols for your website. It speaks the individual protocol APIs, and exposes a simple restful interface for you to access both authentication and profile data from Identity Providers like Google, AOL, Yahoo, Facebook, and MySpace. RPX also pro
XML RPC server is a very popular way of exposing an API to your website. XML RPC server can run standalone. On a past website project I got it running inside Apache so that it could run alongside the main website. (For XMLRPC server in Apache - check my post http://jyro.blogspot.com/2007/11/xml-rpc-server-inside-apache-modpython.html) Implementing the XML RPC server is very easy. First download Ju
Posted by rodrigo.moraes on Wed 27 May 2009 in Datastore User ratings: This method uses the PagerQuery class, which is based on the article "Efficient paging using __key__ instead of a dedicated unique property" [1]. It allows "efficient paging in any query, on any schema, purely in user land, without requiring extra properties or other schema changes". This means that no extra property is requi
class Foo(db.Model): linked = db.ReferenceProperty() someFoo = Foo.get_by_id(1) # Assume we've got an entity with id = 1 # Get key of linked Foo without loading linked entity linkedFooKey = Foo.linked.get_value_for_datastore(someFoo) See discussion here: http://groups.google.com/group/google-appengine/msg/c970bb3636acfa51 Note a suggestion in the above discussion to use a metaclass for automa
The webapp framework does not include code to write cookie directly. Here is a simple cookie class wrap to use code found in Webob lib to set cookies. import UserDict from Cookie import BaseCookie class Cookies(UserDict.DictMixin): def __init__(self,handler,**policy): self.response = handler.response self._in = handler.request.cookies self.policy = policy if 'secure' not in policy and handler
The 1000 file limit has created a problem for folks working outside of the golden path provided by GAE, or even for folks with lots of modules outside of the Web application plumbing. To alleviate this problem, you can create a zip archive of files you need and import module from these like so: import sys sys.path.insert(0, 'cherrypy.zip') sys.path.insert(0, 'mako.zip') import cherrypy fro
このページを最初にブックマークしてみませんか?
『Google Cookbook - Google App Engine』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く