tailieunhanh - Web to py enterprise web framework - p 33
GOOGLE APP ENGINE 305 4 = = The first line imports memcache. The second line has to be a list of memcache sockets (server:port). The third line redefines and in terms of memcache. You could choose to redefine only one of them to define a totally new cache object pointing to the Memcache object. With this tweak the "cache" folder does not need to be a shared folder any more, since it will no longer be accessed. This code requires having memcache servers running on the local network. You should consult the memcache documentation for information on how to. | GOOGLE APP ENGINE 305 4 The first line imports memcache. The second line has to be a list of memcache sockets server port . The third line redefines and in terms of memcache. You could choose to redefine only one of them to define a totally new cache object pointing to the Memcache object. With this tweak the cache folder does not need to be a shared folder any more since it will no longer be accessed. This code requires having memcache servers running on the local network. You should consult the memcache documentation for information on how to setup those servers. Sessions in Memcache If you do need sessions and you do not want to use a load balancer with sticky sessions you have the option to store sessions in memcache 1 from import MEMDB 2 request response db MEMDB Removing Applications In a production setting it may be better not to install the default applications admin examples and welcome. Although these applications are quite small they are not necessary. Removing these applications is as easy as deleting the corresponding folders under the applications folder. Google App Engine It is possible to run WEB2py code on Google App Engine GAE 12 including DAL code with some limitations. The GAE platform provides several advantages over normal hosting solutions Ease of deployment. Google completely abstracts the underlying architecture. Scalability. Google will replicate your app as many times as it takes to serve all concurrent requests 306 DEPLOYMENT RECIPES BigTable. On GAE instead of a normal relational database you store persistent information in BigTable the datastore Google is famous for. The limitations are You have no read or write access to the file system. No transactions You cannot perform complex queries on the datastore in particular there are no JOIN OR LIKE IN and DATE DATETIME operators. This means that WEB2py cannot stores sessions .
đang nạp các trang xem trước