[google-appengine] Re: Does TOS allow multiple versions of one app that do different things?

2009-03-28 Thread Robert
Thanks Andy. I tried a "second" handler as I'd sketched out earlier in the thread, i.e. without it being the "main.py". I then later made that handler the "main.py", but did not see any differences in performance. Would indeed be nice for someone from Google to chime in Robert On Mar 28, 6:

[google-appengine] Re: Does TOS allow multiple versions of one app that do different things?

2009-03-28 Thread Andy Freeman
It's not clear that the app cache expects only one main() per app. I think that the documentation says that it will cache a main() for each handler. http://code.google.com/appengine/docs/python/tools/configuration.html#Script_Handlers says that that an application can have multiple handlers. ht

[google-appengine] Re: Does TOS allow multiple versions of one app that do different things?

2009-03-28 Thread Andy Freeman
The class/__new__ trick isn't the only way to implement a proxy - a function works just as well. If the handlers for several pages are in the same file, one can use a single proxy for all of them. Replace import file1 and ('/pathn', PathnPage) with ('/pathn', File1Proxy('PathnPage')) and def Fi

[google-appengine] Re: Does TOS allow multiple versions of one app that do different things?

2009-03-27 Thread Andy Freeman
It's "easy enough" to load the relevant part of the framework after the dispatch. Use ('/path', Proxy) instead of ('/path', Real) and in a module that does not load any of your framework, define Proxy as: class Proxy(object): def __new__(cls, *args, **kwds): from file import Real

[google-appengine] Re: Does TOS allow multiple versions of one app that do different things?

2009-03-27 Thread Bill
That's a really intriguing solution, cz. It also seems like you could mix different supported languages (e.g. Java if/when it's supported) through the versions mechanism since the language is specified via the 'runtime' keyword in app.yaml. Both java and python versions could access the datastor

[google-appengine] Re: Does TOS allow multiple versions of one app that do different things?

2009-03-27 Thread cz
The problem with the app.yaml solution is that only the handler that has a main() will be cached (I assume that the app cache expects just one main() per app). It would be possible to perform a dispatch in main () to different handlers but it gets a little more messy since you would have to do thi

[google-appengine] Re: Does TOS allow multiple versions of one app that do different things?

2009-03-26 Thread Robert
Hi, you could also in your app.yaml simply define a dedicated/different handler for e.g. those images as they presumably are all under another URL. Then you don't need to think/worry so much about different versions. Just my 2cts. Robert On Mar 27, 12:50 am, "Tom M." wrote: > A very clever so

[google-appengine] Re: Does TOS allow multiple versions of one app that do different things?

2009-03-26 Thread Tom M.
A very clever solution. On Mar 26, 6:31 pm, cz wrote: > Awesome, thanks Jeff. I think doing it this way would make my app use > less resources in general which is good for everybody. > - Claude > > On Mar 26, 2:25 pm, Jeff S wrote: > > > Hi Claude, > > > On Mar 25, 8:27 pm, cz wrote: > > > > T

[google-appengine] Re: Does TOS allow multiple versions of one app that do different things?

2009-03-26 Thread cz
Awesome, thanks Jeff. I think doing it this way would make my app use less resources in general which is good for everybody. - Claude On Mar 26, 2:25 pm, Jeff S wrote: > Hi Claude, > > On Mar 25, 8:27 pm, cz wrote: > > > > > The reason I ask this is for the following scenario: > > My main app u

[google-appengine] Re: Does TOS allow multiple versions of one app that do different things?

2009-03-26 Thread Jeff S
Hi Claude, On Mar 25, 8:27 pm, cz wrote: > The reason I ask this is for the following scenario: > My main app uses Django 1.x and has fairly low, but quite useful ;), > traffic thus often requiring a cold start. It incurs significant > startup time and so the initial requests are quite slow. The