[google-appengine] Re: How to select a single word in stringproperty?

2009-04-18 Thread saintthor

谢谢回复。

我问的是字符串属性部分匹配的问题。按你的方法,只能匹配开头。需要匹配中间的时候,比如在前例里,查找含有 ccc 的对象,该怎么做?


HOW to select the entity with "ccc" in strprop then?

On 4月19日, 上午12时08分, 风笑雪  wrote:
> You can read this 
> document:http://code.google.com/appengine/docs/python/datastore/queriesandinde...
>
> Give you a sample code:
>
> class M(db.Model):
>   s = db.StringProperty()
>
> class H(webapp.RequestHandler):
>   def get(self):
> M(s='aaa bbb ccc ddd').put()
> M(s='eee ddd ccc fff').put()
> M(s='eee').put()
> M(s='eee ').put()
> M(s='eef').put()
>
> entities = M.all().filter('s >= ', 'eee').filter('s <= ', u'eee' +
> u'\ufffd').fetch(10)
> # u'\ufffd' is the largest possible Unicode character
> for entity in entities:
>   self.response.out.write(entity.s + '')
>
> Result:
>
> eee ddd ccc fff
> eee
> eee
>
> 2009/4/18 saintthor 
>
>
>
> > entities1.strprop = "aaa bbb ccc ddd"
> > entities2.strprop = "eee ddd ccc fff"
>
> > using qerry or gql, HOW to select the entity with "eee" in strprop?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Images API still limited to 1MB

2009-04-18 Thread Anuraag Agrawal

Indeed the entire API is limited to 1MB, but the point of discussion
I'd like to make is that for data-related API calls like the datastore
and memcache, it's easy to come up with hardware/implementation
constraints that would warrant such a limit, and there are usually
relatively simple ways to work around them.  For a processing API call
like an image API call, there should be no dependence on BigTable or
any sort of clustering, so the limit seems a little arbitrary,
especially in light of the request limit increase to 10MB which does
not seem to have any value for image requests.  I'm honestly hoping
it's just an oversight that will be fixed in the short term.

In the interim, using an external image API seems to be the best
solution indeed.  Right now, I'm looking into the Imageshack API which
seems to offer enough functionality, but can you go into how you use
the Picasa API?  It seems to be very well suited to importing a user's
photos, but to upload and manage photos as a website would require
using ClientLogin, and since ClientLogin uses a captcha, it doesn't
work well on app engine.  Or at least, that's what's written in the
App Engine Data API docs.

Thanks.

On Apr 18, 10:55 pm, Tim Hoffman  wrote:
> Why don't you stick the images in Picasa and just manage them through
> app engine ?
>
> Thats what I am doing
>
> T
>
> On Apr 18, 4:28 pm, Anuraag Agrawal  wrote:
>
> > When App Engine raised its request size limit from 1MB to 10MB, it
> > seemed like we would finally be able to use it for an image sharing
> > website as while reasonably sized digital camera images over 1MB are
> > very likely, it'd take an extremely professional camera image to break
> > the 10MB limit, which seemed like an acceptable limit to place on a
> > user's file uploads since those users are probably knowledgeable
> > enough to resize the images themselves anyways.  API calls were still
> > limited to 1MB, and as the examples listed on the blog post were
> > memcache and datastore, it seemed to make sense since App Engine is
> > probably still designed to place a 1MB limit on its datastore
> > entries.   This seemed like it'd be ok since it should be possible to
> > use the images API to resize any input images to less than 1MB before
> > storing them in the datastore, completely acceptable for our task.
> > However, after trying this and looking into some server errors, it
> > seems the images API is also limited to 1MB input files (which fits
> > with the 1MB limit on API calls, the fact just didn't register at
> > first).  At least, that's how I'm interpreting the RequestTooLargeError
> > (The request to API call images.Transform() was too large) I get when
> > submitting a 1.5MB file.
>
> > Is the limit on the images API by design/constraint?  I imagine image
> > API calls aren't split across computers in a cluster or anything and
> > are run in place, with possibly some temp memory that's cleared
> > immediately, which makes having a limit smaller than the request size
> > seem a little strange to me.  A 1MB limit on image files makes it hard
> > to support user submitted image uploads in a practical setting.  I
> > know it's possible to split the image over datastore entries just to
> > store them, but we also need to be able to resize them to generate
> > thumbnails, etc.
>
> > And if anyone's come up with a workaround splitting the input file
> > into parts to resize in parts, it'd be nice to hear.  While PNG uses
> > DEFLATE and might not work, JPEG as far as I know cosine transforms
> > blocks independently so it seems like it could be possible. Though
> > it'd probably increase the load on the servers more than just having a
>
> > >1MB API call limit.
>
> > Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] errors with django.

2009-04-18 Thread Aaron

I need to know how the urls work.

I  would get errors on all 3 pages plus the admin.

here is the error:

: Caught an exception
while rendering: Reverse for 'settings.contact-consultation-request'
with arguments '()' and keyword arguments '{}' not found. Original
Traceback (most recent call last): File "/home/aaron/websites/
Chillenvillen.com/apps/google_app_engine/mci-new2/common/zip-packages/
django-1.0.2.zip/django/template/debug.py", line 71, in render_node
File "/home/aaron/websites/Chillenvillen.com/apps/google_app_engine/
mci-new2/common/zip-packages/django-1.0.2.zip/django/template/
defaulttags.py", line 378, in render args=args, kwargs=kwargs) File "/
home/aaron/websites/Chillenvillen.com/apps/google_app_engine/mci-new2/
common/zip-packages/django-1.0.2.zip/django/core/urlresolvers.py",
line 254, in reverse File "/home/aaron/websites/Chillenvillen.com/apps/
google_app_engine/mci-new2/common/zip-packages/django-1.0.2.zip/django/
core/urlresolvers.py", line 243, in reverse NoReverseMatch: Reverse
for 'settings.contact-consultation-request' with arguments '()' and
keyword arguments '{}' not found.
  args = (u"Caught an exception while rendering: Reverse
for...uments '()' and keyword arguments '{}' not found.",)
  exc_info = (,
NoReverseMatch("Reverse for 'settings.contact-co...nts '()' and
keyword arguments '{}' not found.",), )
  message = u"Caught an exception while rendering: Reverse
for...uments '()' and keyword arguments '{}' not found."
  source = (, (894, 932))



when I change the url.py and take out contact.views  out of url.py.
then this error would disappear.
yet the forms would still not work.

I would get this error when I submit the forms:

'str' object is not callable

that's it. I don't know whats the problem. I asked in django's group
and not many people had any idea what's wrong.

Some told me to try this and that but it didn't work.

does anyone here know what could be the problem?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Retrieving Large Query Sets Containing Inequality Operators

2009-04-18 Thread Chris

I have the model:

class Record(db.Model):
  date = db.DateProperty()

Over 1000 Record instances may contain the same date value. The
instances are also not created in the order of their dates.

I'm trying to query all instances whose date is within a given range.
I need to be able to query sets larger than the default max of 1000.

I was thinking of doing something like:

Record.all().filter('date >', startDate).filter('date <', endDate)

But this would limit me at most to the first 1000 records. How would I
get the next 1000 records, maintaining the range query? I can't use
the last date value from the previous query as the startDate for the
next query, since there's no guarantee that the date value has
changed. For example, I could have 2000 instances with the date
2008-1-1, so the first and second query sets have identical filter
parameters.

Intuitively, I could accomplish this by simply filtering on the
previous key value (e.g. .filter('key >', lastKeyValue)).
Unfortunately, App Engine currently prohibits filtering with
inequality operators on more than one property.

Am I correct in understanding that there's essentially no way to query
all instances within a specific date range, due to this limitation?

This issue keeps coming up for me, and has been a huge deal-breaker in
a lot of potential projects I've been working on for App Engine. Any
advice on how I could work around it would be appreciated.

Chris
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Does AppEngine prevent you from importing a module added to sys.path?

2009-04-18 Thread 风笑雪
I think there is no such limit in GAE.

http://code.google.com/intl/zh-CN/appengine/articles/django10_zipimport.html

import sys
sys.path.insert(0, 'django.zip')

import django.forms.fields


2009/4/19 Lee Olayvar 

> I am trying to import a module, found in a subdirectory of my app. This app
> directory is added to the sys.path list, but it fails if i try to import
> it.. does AppEngine prevent this?
>
> Note that you may wonder who i don't just import the module via its full
> python path (import somepackage.package.module). The reason is the module is
> a 3rd party library that if nested like that, refuses to work. It needs to
> think its a root library, so adding it to the sys.path _should_ work, but
> AppEngine seems to be preventing that..
>
> Any ideas?
> --
> Lee Olayvar
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: testing application error handling

2009-04-18 Thread Andy Freeman

Sounds like http://code.google.com/p/googleappengine/issues/detail?id=915
.

Please star and comment as appropriate.

On Apr 18, 1:34 pm, iceanfire  wrote:
> According to the google maps team, we have to expect atleast some
> [small] amounts of datastore errors.
>
> Is there anyway to get the SDK to throw these errors, so I can better
> test how my application responds when a specific query is denied (i.e
> make sure the right code kicks in and handles the error?)
>
> Or, a broader question: how do you ensure that your application can
> recover from errors?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Does AppEngine prevent you from importing a module added to sys.path?

2009-04-18 Thread Lee Olayvar
Yup, disregard this whole post. :)

(Why is it that i spent hours on this, then i find the answer after posting?
:o)

On Sat, Apr 18, 2009 at 7:29 PM, Lee Olayvar  wrote:

> Hmm, i'm starting to suspect it may be with how AE is caching main()..
>
> On Sat, Apr 18, 2009 at 7:15 PM, Lee Olayvar  wrote:
>
>> I am trying to import a module, found in a subdirectory of my app. This
>> app directory is added to the sys.path list, but it fails if i try to import
>> it.. does AppEngine prevent this?
>>
>> Note that you may wonder who i don't just import the module via its full
>> python path (import somepackage.package.module). The reason is the module is
>> a 3rd party library that if nested like that, refuses to work. It needs to
>> think its a root library, so adding it to the sys.path _should_ work, but
>> AppEngine seems to be preventing that..
>>
>> Any ideas?
>> --
>> Lee Olayvar
>>
>
>
>
> --
> Lee Olayvar
>



-- 
Lee Olayvar

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Does AppEngine prevent you from importing a module added to sys.path?

2009-04-18 Thread Lee Olayvar
Hmm, i'm starting to suspect it may be with how AE is caching main()..

On Sat, Apr 18, 2009 at 7:15 PM, Lee Olayvar  wrote:

> I am trying to import a module, found in a subdirectory of my app. This app
> directory is added to the sys.path list, but it fails if i try to import
> it.. does AppEngine prevent this?
>
> Note that you may wonder who i don't just import the module via its full
> python path (import somepackage.package.module). The reason is the module is
> a 3rd party library that if nested like that, refuses to work. It needs to
> think its a root library, so adding it to the sys.path _should_ work, but
> AppEngine seems to be preventing that..
>
> Any ideas?
> --
> Lee Olayvar
>



-- 
Lee Olayvar

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Does AppEngine prevent you from importing a module added to sys.path?

2009-04-18 Thread Lee Olayvar
I am trying to import a module, found in a subdirectory of my app. This app
directory is added to the sys.path list, but it fails if i try to import
it.. does AppEngine prevent this?

Note that you may wonder who i don't just import the module via its full
python path (import somepackage.package.module). The reason is the module is
a 3rd party library that if nested like that, refuses to work. It needs to
think its a root library, so adding it to the sys.path _should_ work, but
AppEngine seems to be preventing that..

Any ideas?
-- 
Lee Olayvar

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Google's ext.webapp.template module

2009-04-18 Thread 风笑雪
GAE's template is a part of Django 0.96. You don't have to use it,
import django.template is also ok, or even Mako's template.

2009/4/19 GenghisOne 

>
> What practically happens when this directive is executed?
> *
> from google.appengine.ext.webapp import template
> *
>
> Is this importing Django or something else?
>
>
> The reason why I ask this is I'm a newbie to GAE and want to walk
> before I can run...on the surface Django looks powerful but there are
> so many moving parts in it that it hurts my brain.
>
> Anyone have an example of how to iterate over a list using Google's
> vanilla templating framework...
>
> for instance this is a snippet from a Django html template...
>
> {% for message in messages %}
> {{ message.title }}
>
>
> Anyway I could replicate this functionality without Django and if so
> how?
>
>
> Thanks much.
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Timeout: datastore timeout: operation took too long.

2009-04-18 Thread Ray Malone

Today, my app has seen 2 timeout errors at 3:10 pm according to the
log.  Each one was 30 seconds apart.  One was a Get and the other a
Put.  Each on totally different classes that are not connected in any
way.

On Apr 17, 4:15 pm, Brandon Thomson  wrote:
> Google will not really acknowledge this as a problem or defect but
> neither do they provide a lot of options for workaround. My experience
> is that Timeouts do occur on about 0.5% of puts regardless of size of
> entity. These are root entities. It is not caused by write contention
> from multiple requests on the entity. A handler only called by
> periodic cron job will experience it.
>
> For one week in March when they were playing around with the
> architecture Timeouts went from about 0.5% of all puts to about 5%.
> Since it has been not as bad. There was an open defect but they
> recently closed 
> it:http://code.google.com/p/googleappengine/issues/detail?id=764
>
> I agree with notcourage about queues being a good solution and this is
> what I do because the data has to go somewhere. Currently I am using
> SQS. But a perhaps more important question is, is the time you spend
> implementing these workarounds better spent implementing your app on a
> different platform? I honestly don't know the answer, maybe notcourage
> has a better idea. I am curious to hear any more thoughts you have.
> Because if we are trying to make money this is always at front of
> mind.
>
> On Apr 17, 12:14 pm, notcourage  wrote:
>
> > Good for you that your company has good prospects. As somebody who has
> > built high traffic sites (co-founder of IGN.com), I offer some advice:
> > Don't even think about driving traffic to it unless it has been stable
> > for weeks. If you are having problems w/ minute traffic, you can't
> > imagine how bad it will be under load. Plan for graceful degradation.
> > Some possible degradations: Read-only mode except for existing
> > registered users. Static site.
>
> > Another thing to try is to queue put's in memcache, in a simple
> > datastore q, or inhttp://aws.amazon.com/sqs/. The deferred put's can
> > be stored as simple Strings using the Pickler.
>
> > On Apr 17, 5:12 am,RayMalone  wrote:
>
> > > Speaking only for my app, I can tell this is not an application
> > > issue.  My datastore is made up of only root entities and in most
> > > cases works well quickly.  My app doesn't see large volumes of
> > > requests per second and it's more like requests per minute.     There
> > > is no possible way the errors I'm seeing are from contention given the
> > > minutes between requests.  And, the same exact process is handled a
> > > few hours before within 600ms.      My app is soon to increase in
> > > volume and needs to be stable.  I love using app engine, but I've
> > > never faced errors like this on any other platform from IIS Server and
> > > SQL Server to PHP and MY SQL or even Unix and Oracle.   Don't get me
> > > wrong, I understand the difference in the platforms, If there is
> > > anything I can do to prevent this I would love to know.  I'm not
> > > moving my app, but need to find a solution.  My company will be on the
> > > local NBC news (I will be mentioning app engine) and may see a huge
> > > volume hitting the site next week.
>
> > > On Apr 17, 4:54 am, Sylvain  wrote:
>
> > > > Datastoretimeoutis one of the biggest (and oldest) issue with GAE
> > > > and mostly because it is random.
> > > > You can get it on get, put, fetch,... even with few entities.
>
> > > > I hope that soon, datastoretimeoutwill be negligible. Currently, it
> > > > is not the case.
>
> > > > Regards
>
> > > > On 17 avr, 09:50, Paul Kinlan  wrote:
>
> > > > > Hi,
>
> > > > > I would just like to add myself into this, my app twitterautofollow 
> > > > > (twollo)
> > > > > regularly gets DataStore time outs on puts (in the most part).  All my
> > > > > entities are root entities.
>
> > > > > I did have a thread open on this only a few days ago.
>
> > > > > Paul
>
> > > > > 2009/4/17RayMalone 
>
> > > > > > I'm seeing random timeouts where there are many seconds or minutes
> > > > > > between requests and hours before app engine handled the same 
> > > > > > request
> > > > > > within 400ms.  I hit another one today that will actually cost my
> > > > > > business, not much but some.  My app needs to catch these and I am 
> > > > > > on
> > > > > > many pain points.    However, I think the timeouts needs addressed.
>
> > > > > > On Apr 16, 7:10 pm, DarkCoiote  wrote:
> > > > > > > Yes... I've read that...
>
> > > > > > > The problem with using all entities as root is that I'm unable to 
> > > > > > > use
> > > > > > > transactions as it is... I would have to code a lit bit... 
> > > > > > > although
> > > > > > > I just found a paper describing a project that seems really good.
>
> > > > > > >http://danielwilkerson.com/dist-trans-gae.html
>
> > > > > > > I think it will be presented this weekend, and I really hope that
> > > > > > > it goes "public" or eve

[google-appengine] Re: memcache.set() and memcache.add() fail silently if time is greater than one month

2009-04-18 Thread 风笑雪
Why can't you just use memcache.set(key), and use a cron job to delete every
month: memcache.delete(key).

2009/4/19 michael 

>
> eg,  memcache.set(key, value, 90 * 24 * 3600) # silently fails to set
> the cache value
>
> Relevant doc show below but WTF is "one month" ? 28 days? or 29? or
> 30? or 31? Depends on what it month it is? :-p
>
>
> set(key, value, time=0, min_compress_len=0)
>
>Sets a key's value, regardless of previous contents in cache.
>
>Arguments: ...
>
>time
>Optional expiration time, either relative number of seconds
> from current time (up to 1 month), or an absolute Unix epoch time. By
> default, items never expire, though items may be evicted due to memory
> pressure. Float values will be rounded up to the nearest whole second.
>
>
> Reference:
> http://code.google.com/appengine/docs/python/memcache/functions.html
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Google Apps account - can't enable HTTPS or remove App Engine from domain

2009-04-18 Thread 风笑雪
BTW, you can try to set a new version in your app.yaml.

2009/4/19 风笑雪 

> There is no way to disable GAE except deleting the app.yaml file, and I
> don't think it will work.
> Your apps need at least one domain for GAE( if you ever create one ). So
> you can try add an new domain, delete the old one, then add it again.
>
> 2009/4/19 Chris L 
>
>
>> I set up App Engine with a Google Apps domain one year ago. Now I am
>> informed that "You must re-install this application to enable secure
>> access for your users." Problem is, if I try to disable the App Engine
>> service, nothing happens, even after hours of waiting. I have App
>> Engine enabled for the naked domain, which might be part of the
>> problem, and I can't remove that either.
>>
>>
>>
>> >>
>>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Google Apps account - can't enable HTTPS or remove App Engine from domain

2009-04-18 Thread 风笑雪
There is no way to disable GAE except deleting the app.yaml file, and I
don't think it will work.
Your apps need at least one domain for GAE( if you ever create one ). So you
can try add an new domain, delete the old one, then add it again.

2009/4/19 Chris L 

>
> I set up App Engine with a Google Apps domain one year ago. Now I am
> informed that "You must re-install this application to enable secure
> access for your users." Problem is, if I try to disable the App Engine
> service, nothing happens, even after hours of waiting. I have App
> Engine enabled for the naked domain, which might be part of the
> problem, and I can't remove that either.
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Remove naked domain from appengine application

2009-04-18 Thread Chris L

I have exactly the same problem. I will post here if I actually ever
get it solved.

On Apr 14, 5:32 pm, mifki  wrote:
> I have appengine application installed for my google apps domain and
> naked domain specified for it. I can't neither remove that domain nor
> disable entire application. I know this is common problem after naked
> domain disallowed but I didn't find any solution or whom to contact to
> solve this problem. Any help?
>
> I think this problem is more Google Apps-related than App Engine-
> related but I asked in Google Apps support group
>
> http://www.google.com/support/forum/p/Google+Apps/thread?fid=2cc94e6c...
>
> but Advisor said she can't help with any App Engine problems, so I'm
> trying to aske here.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: sort on _key_ out of order

2009-04-18 Thread 风笑雪
Well, but I don't care it, my application allows the same ID, I just need it
for sorting, and it's harder to sort by time when the browser do an AJAX
get. Some times I need handle the timezone difference between server
and browser.
If you want keep a unique ID, the best way is set its key_name, and try
again if put failed.

2009/4/19 djidjadji 

>
> If two requests want to create an M() they will get the same ID.
> You must use some kind of transaction to get unique IDs
>
> 2009/4/18 风笑雪 :
> > I use this code to keep an id:
> > class M(db.Model):
> >   id = db.IntegerProperty()
> >   time = db.DateTimeProperty(auto_now_add=True)
> >@staticmethod
> >def max_id():
> > maxID = memcache.get('MaxID')
> > if maxID:
> >   return maxID
> > messages = Message.all()
> > messages.order("-id")
> > message = messages.get()
> > if message:
> >   return message.id
> > else:
> >   return 0
> > entity = M()
> > entity.id = M.maxID + 1
> > entity.put()
> > 2009/4/19 David Wilson 
> >>
> >>
> >> thanks! i missed that in the docs :)
> >>
> >> I wasnt using a datetime just to save a bit of space, but i can see i
> >> need to know to guarantee ordering, or if i want to do ordered paging
> >> via key i would need to handle key creation myself to make sure they
> >> are in order.
> >>
> >> This becomes harder in one case for me as users can create designs
> >> that need to be paged through in creation order. There will be too
> >> much contention on a glodal counter for this, so i guess an offset
> >> page on date is the best i can do for now. Or just not worry when some
> >> 'new designs' are out of order.
> >>
> >>
> >>
> >> On Apr 18, 2:20 am, David Symonds  wrote:
> >> > On Sat, Apr 18, 2009 at 3:21 PM, David Wilson
> >> >
> >> >  wrote:
> >> > > Is this expected behaviour? and thus do i need to always give a
> >> > > key_name to guarantee order? this creates scaling issues for order
> >> > > counter (which is probably why its not in order in the backend :) )
> >> >
> >> > Keys are only guaranteed to be unique, not sequential or in order:
> >> >
> >> >
> http://code.google.com/appengine/docs/python/datastore/keysandentityg...
> >> >
> >> > What is wrong with giving your models a timestamp property (with
> >> > auto_now_add=True), and sorting by that?
> >> >
> >> > Dave.
> >>
> >
> >
> > >
> >
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Google Apps account - can't enable HTTPS or remove App Engine from domain

2009-04-18 Thread Chris L

I set up App Engine with a Google Apps domain one year ago. Now I am
informed that "You must re-install this application to enable secure
access for your users." Problem is, if I try to disable the App Engine
service, nothing happens, even after hours of waiting. I have App
Engine enabled for the naked domain, which might be part of the
problem, and I can't remove that either.



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: 500 Error uploading indexes. Need to clear indexes.

2009-04-18 Thread ssg123

Worked without any problems.  Thanks!

On Apr 17, 4:47 pm, "Jeff S (Google)"  wrote:
> Hello,
>
> I've errored out the stuck indexes so you should now be able to vacuum
> them and upload new ones. Please let me know how it goes :-)
>
> Thank you,
>
> Jeff
>
> On Apr 17, 12:22 am, ssg123  wrote:
>
>
>
> > I have many unneeded indexes that have been stuck in the building
> > phase for days now (a result of not understanding how indexes
> > worked).  This appears to be preventing me from uploading necessary
> > indexes (receive 500 error on attempted upload).  As a result, my app
> > is broken.  Is it possible to clear all of the indexes and start over
> > from scratch?  App ID is ssgpipeline.- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: sort on _key_ out of order

2009-04-18 Thread djidjadji

If two requests want to create an M() they will get the same ID.
You must use some kind of transaction to get unique IDs

2009/4/18 风笑雪 :
> I use this code to keep an id:
> class M(db.Model):
>   id = db.IntegerProperty()
>   time = db.DateTimeProperty(auto_now_add=True)
>@staticmethod
>def max_id():
> maxID = memcache.get('MaxID')
> if maxID:
>   return maxID
> messages = Message.all()
> messages.order("-id")
> message = messages.get()
> if message:
>   return message.id
> else:
>   return 0
> entity = M()
> entity.id = M.maxID + 1
> entity.put()
> 2009/4/19 David Wilson 
>>
>>
>> thanks! i missed that in the docs :)
>>
>> I wasnt using a datetime just to save a bit of space, but i can see i
>> need to know to guarantee ordering, or if i want to do ordered paging
>> via key i would need to handle key creation myself to make sure they
>> are in order.
>>
>> This becomes harder in one case for me as users can create designs
>> that need to be paged through in creation order. There will be too
>> much contention on a glodal counter for this, so i guess an offset
>> page on date is the best i can do for now. Or just not worry when some
>> 'new designs' are out of order.
>>
>>
>>
>> On Apr 18, 2:20 am, David Symonds  wrote:
>> > On Sat, Apr 18, 2009 at 3:21 PM, David Wilson
>> >
>> >  wrote:
>> > > Is this expected behaviour? and thus do i need to always give a
>> > > key_name to guarantee order? this creates scaling issues for order
>> > > counter (which is probably why its not in order in the backend :) )
>> >
>> > Keys are only guaranteed to be unique, not sequential or in order:
>> >
>> >  http://code.google.com/appengine/docs/python/datastore/keysandentityg...
>> >
>> > What is wrong with giving your models a timestamp property (with
>> > auto_now_add=True), and sorting by that?
>> >
>> > Dave.
>>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Announcing BDBDatastore, a replacement datastore for App Engine

2009-04-18 Thread Nick Johnson

On Apr 18, 11:34 pm, Dag  wrote:
> Very cool, but I don't know if this will solve the 'practical lock in'
> problem for GAE python. It may be hard to find a hosting provider that
> offers django along with long-running java processes.

I don't expect this to be used by people wanting to host on shared
infrastructure. This ought to be useful for anyone running anything
from their own VPS to a small cluster (presuming no app they run
requires more datastore than a single server can host). If it becomes
a practical alternative, I expect we'd see alternate hosts for App
Engine apps, using this or another datastore backend.

> Still, GAE-J developers now have a reasonable alternative and maybe
> some of your efforts can be applied to an all python version for BDB
> (or zodb).
>
> Thanks!
> -Tim
>
> On Apr 17, 9:59 am, Nick Johnson  wrote:
>
> > On Apr 17, 5:50 pm, johnP  wrote:
>
> > > Quick question (I have not looked at your datastore at all yet) -
>
> > > Can using your datastore eliminate the limit of 1000 entities on a
> > > fetch?  Thanks -
>
> > BDBDatastore itself doesn't enforce any limits on results returned,
> > but it suffers all the same problems the App Engine datastore (and,
> > indeed, any other DB) does with it - doing a fetch for results 5000 to
> > 5010 is very nearly as expensive as fetching the first 5010 results.
> > Bear in mind, too, that you can't just choose to use BDBDatastore
> > while hosting your app with Google - it's intended for use when
> > hosting an app on your own (or someone else's) infrastructure.
>
> > -Nick
>
> > > johnP
>
> > > On Apr 17, 8:06 am, Nick Johnson  wrote:
>
> > > > Recently I've been working on a replacement datastore backend for App
> > > > Engine, to allow hosting apps in a production environment (eg, not the
> > > > dev_appserver), outside Google's cloud. Thanks largely to the long
> > > > easter weekend, it's now at a point where I feel comfortable showing
> > > > it off, and soliciting contributions and comments (including a better
> > > > name).
>
> > > > The short:
>
> > > > It's called BDBDatastore, you can find basic details 
> > > > athttp://arachnid.github.com/bdbdatastore/andprojectstatusathttp://wiki.github.com/Arachnid/bdbdatastore.
> > > >  It's written in Java,
> > > > runs as a standalone server, uses BDB-JE for the datastore backend,
> > > > and will support everything the dev_appserver and production
> > > > datastores support. It's not yet ready for deployment, but will be
> > > > soon.
>
> > > > The long:
>
> > > > See my blog entry 
> > > > here:http://blog.notdot.net/Announcing-BDBDatastore-a-replacement-datastor...
> > > > .
>
> > > > Mandatory disclaimer: I work for Google, and as of recently, I'm a
> > > > Developer Programs Engineer for Google App Engine. All of my opinions
> > > > here (on my personal account) are my own, of course, not Google's, and
> > > > BDBDatastore is developed in my own time, with my own resources,
> > > > completely independently of my work at Google.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Announcing BDBDatastore, a replacement datastore for App Engine

2009-04-18 Thread Dag

Very cool, but I don't know if this will solve the 'practical lock in'
problem for GAE python. It may be hard to find a hosting provider that
offers django along with long-running java processes.

Still, GAE-J developers now have a reasonable alternative and maybe
some of your efforts can be applied to an all python version for BDB
(or zodb).

Thanks!
-Tim

On Apr 17, 9:59 am, Nick Johnson  wrote:
> On Apr 17, 5:50 pm, johnP  wrote:
>
> > Quick question (I have not looked at your datastore at all yet) -
>
> > Can using your datastore eliminate the limit of 1000 entities on a
> > fetch?  Thanks -
>
> BDBDatastore itself doesn't enforce any limits on results returned,
> but it suffers all the same problems the App Engine datastore (and,
> indeed, any other DB) does with it - doing a fetch for results 5000 to
> 5010 is very nearly as expensive as fetching the first 5010 results.
> Bear in mind, too, that you can't just choose to use BDBDatastore
> while hosting your app with Google - it's intended for use when
> hosting an app on your own (or someone else's) infrastructure.
>
> -Nick
>
>
>
>
>
> > johnP
>
> > On Apr 17, 8:06 am, Nick Johnson  wrote:
>
> > > Recently I've been working on a replacement datastore backend for App
> > > Engine, to allow hosting apps in a production environment (eg, not the
> > > dev_appserver), outside Google's cloud. Thanks largely to the long
> > > easter weekend, it's now at a point where I feel comfortable showing
> > > it off, and soliciting contributions and comments (including a better
> > > name).
>
> > > The short:
>
> > > It's called BDBDatastore, you can find basic details 
> > > athttp://arachnid.github.com/bdbdatastore/andprojectstatus 
> > > athttp://wiki.github.com/Arachnid/bdbdatastore. It's written in Java,
> > > runs as a standalone server, uses BDB-JE for the datastore backend,
> > > and will support everything the dev_appserver and production
> > > datastores support. It's not yet ready for deployment, but will be
> > > soon.
>
> > > The long:
>
> > > See my blog entry 
> > > here:http://blog.notdot.net/Announcing-BDBDatastore-a-replacement-datastor...
> > > .
>
> > > Mandatory disclaimer: I work for Google, and as of recently, I'm a
> > > Developer Programs Engineer for Google App Engine. All of my opinions
> > > here (on my personal account) are my own, of course, not Google's, and
> > > BDBDatastore is developed in my own time, with my own resources,
> > > completely independently of my work at Google.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] memcache.set() and memcache.add() fail silently if time is greater than one month

2009-04-18 Thread michael

eg,  memcache.set(key, value, 90 * 24 * 3600) # silently fails to set
the cache value

Relevant doc show below but WTF is "one month" ? 28 days? or 29? or
30? or 31? Depends on what it month it is? :-p


set(key, value, time=0, min_compress_len=0)

Sets a key's value, regardless of previous contents in cache.

Arguments: ...

time
Optional expiration time, either relative number of seconds
from current time (up to 1 month), or an absolute Unix epoch time. By
default, items never expire, though items may be evicted due to memory
pressure. Float values will be rounded up to the nearest whole second.


Reference: http://code.google.com/appengine/docs/python/memcache/functions.html


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Newbie First Upload Problems

2009-04-18 Thread Wooble

Are you accessing your app through appspot?

On Apr 17, 11:39 pm, codingJoe  wrote:
> I'll tell the newbie story on how I got into this mess.
>
> I developed a small app and tested on my laptop using the AppEngine
> SDK.  I got my app to point that it was working the way I wanted.
> Now, I'm ready to test it online.   I'm a perfectionist about some
> things, so I don't want to public to see my app until I've
> thoroughally tested it online.
>
> In order to build my little staging area, I restricted the app to my
> group's domain-name.  I uploaded it and the first couple screens
> seemed to work.  Then I clicked on some of the user functions and
> things started to break.  Here's my errors.   Can someone help me
> understand what's going on here?  I'm beginning to get confused.
>
>  'login_url' : users.CreateLoginURL(self.request.uri),
>   File "/base/python_lib/versions/1/google/appengine/api/users.py",
> line 176, in create_login_url
>     raise NotAllowedError
> NotAllowedError
>
> I start commenting things out to try my app without logins.  And Now
> every time I access usernames I get errors with None type.
>
> Advice?   how do I fix this?  What steps to troubleshoot?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] dumb guy trying to access datastore remotely with remote_api

2009-04-18 Thread Ben Nevile

I was able to get appengine_console.py to launch in OS X with the help
of this message:

http://groups.google.com/group/google-appengine/browse_thread/thread/6bc2f759188476b2/967e636458681da0?lnk=gst&q=interactive+console+remote+api#967e636458681da0


When I try and fetch data, it asks for my name and password.  My admin
name and pass come back as invalid.  Is there anything clever I need
to do to get this to work?  I only have one admin account on this
particular app, sanity checked by logging in and out to the admin
console.

thanks in advance.
Ben
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] testing application error handling

2009-04-18 Thread iceanfire

According to the google maps team, we have to expect atleast some
[small] amounts of datastore errors.

Is there anyway to get the SDK to throw these errors, so I can better
test how my application responds when a specific query is denied (i.e
make sure the right code kicks in and handles the error?)

Or, a broader question: how do you ensure that your application can
recover from errors?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] becoming an app administrator with google apps account

2009-04-18 Thread jhf555

I'm trying to send email on GAE with my Google Apps primary email as
the "From" email address.
So I need to add that email address (which is i...@bigriddles.com) as
an Administrator for my app.
However, I'm having trouble doing this.  I add that email as an
adminstrator and receive the invite email, which offers two options,
as follows:

1. "sign in with your Google Account " - this doesn't work because
even though i...@bigriddles.com is the admininstrator email for the
Google Apps account, Google for some reason doesn't recognize this as
a "Google Account".  So it gives me a "wrong username or password"
error when I try to confirm the invitation by signing in with this.

2. "if i...@bigriddles.com is a Google Apps Account, you can sign in
and accept or decline this invitation here" - The problem here is that
when I try to use this option, it asks for me to confirm the account
with a cell phone number.  And of course I've already confirmed
another account with my cell phone number, so it won't let me do this.

Any suggestions?  Thanks in advance!

-Jon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Redirect all calls to appengine url to my Google Apps url

2009-04-18 Thread richardcur...@googlemail.com

I tried it. But when I call my appspot url now directly I get a
webpage:

Error: Server Error
The server encountered an error and could not complete your request.
If the problem persists, please report your problem and mention this
error message and the query that caused it.


My main domain works - except the calls to the appspot domain. I
cannot use it this way :(


On Apr 18, 4:48 pm, ctran  wrote:
> Try this:
>
>  http://appengine-cookbook.appspot.com/recipe/redirect-from-appspot-to...
>
> On Apr 18, 9:18 am, "richardcur...@googlemail.com"
>
>  wrote:
> > I know in principle how to redirect.
>
> > The point is, all appengine python handler classes are identical for
> > both
>
> >http://example.appspot.comandhttp://www.example.com
>
> > So I had to check in EVERY python handler class - is the call coming
> > from example.appspot.com - if yes redirect towww.example.com. This is
> > madness.
>
> > The question is how to globally set for all my python classes to
> > redirect this call.
>
> > - Ricky
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Google's ext.webapp.template module

2009-04-18 Thread GenghisOne

What practically happens when this directive is executed?
*
from google.appengine.ext.webapp import template
*

Is this importing Django or something else?


The reason why I ask this is I'm a newbie to GAE and want to walk
before I can run...on the surface Django looks powerful but there are
so many moving parts in it that it hurts my brain.

Anyone have an example of how to iterate over a list using Google's
vanilla templating framework...

for instance this is a snippet from a Django html template...

{% for message in messages %}
{{ message.title }}


Anyway I could replicate this functionality without Django and if so
how?


Thanks much.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: sort on _key_ out of order

2009-04-18 Thread 风笑雪
I use this code to keep an id:

class M(db.Model):
  id = db.IntegerProperty()
  time = db.DateTimeProperty(auto_now_add=True)
   @staticmethod
   def max_id():
maxID = memcache.get('MaxID')
if maxID:
  return maxID
messages = Message.all()
messages.order("-id")
message = messages.get()
if message:
  return message.id
else:
  return 0

entity = M()
entity.id = M.maxID + 1
entity.put()

2009/4/19 David Wilson 

>
>
> thanks! i missed that in the docs :)
>
> I wasnt using a datetime just to save a bit of space, but i can see i
> need to know to guarantee ordering, or if i want to do ordered paging
> via key i would need to handle key creation myself to make sure they
> are in order.
>
> This becomes harder in one case for me as users can create designs
> that need to be paged through in creation order. There will be too
> much contention on a glodal counter for this, so i guess an offset
> page on date is the best i can do for now. Or just not worry when some
> 'new designs' are out of order.
>
>
>
> On Apr 18, 2:20 am, David Symonds  wrote:
> > On Sat, Apr 18, 2009 at 3:21 PM, David Wilson
> >
> >  wrote:
> > > Is this expected behaviour? and thus do i need to always give a
> > > key_name to guarantee order? this creates scaling issues for order
> > > counter (which is probably why its not in order in the backend :) )
> >
> > Keys are only guaranteed to be unique, not sequential or in order:
> >  http://code.google.com/appengine/docs/python/datastore/keysandentityg.
> ..
> >
> > What is wrong with giving your models a timestamp property (with
> > auto_now_add=True), and sorting by that?
> >
> > Dave.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] How are cookies sent?

2009-04-18 Thread richardcur...@googlemail.com

Hi,

Sorry if this is a dumb question.


I am watching the HTTP headers of two of my appengine locations.
Downloading files from one always sends cookies along the request.

The other appengine does not.


I want to prevent cookies being sent. How do I do that?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Redirect all calls to appengine url to my Google Apps url

2009-04-18 Thread richardcur...@googlemail.com

Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: sort on _key_ out of order

2009-04-18 Thread David Wilson


thanks! i missed that in the docs :)

I wasnt using a datetime just to save a bit of space, but i can see i
need to know to guarantee ordering, or if i want to do ordered paging
via key i would need to handle key creation myself to make sure they
are in order.

This becomes harder in one case for me as users can create designs
that need to be paged through in creation order. There will be too
much contention on a glodal counter for this, so i guess an offset
page on date is the best i can do for now. Or just not worry when some
'new designs' are out of order.



On Apr 18, 2:20 am, David Symonds  wrote:
> On Sat, Apr 18, 2009 at 3:21 PM, David Wilson
>
>  wrote:
> > Is this expected behaviour? and thus do i need to always give a
> > key_name to guarantee order? this creates scaling issues for order
> > counter (which is probably why its not in order in the backend :) )
>
> Keys are only guaranteed to be unique, not sequential or in order:
>  http://code.google.com/appengine/docs/python/datastore/keysandentityg...
>
> What is wrong with giving your models a timestamp property (with
> auto_now_add=True), and sorting by that?
>
> Dave.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Project scripts recovery

2009-04-18 Thread 风笑雪
Maybe it would be helpful:
http://code.google.com/p/appfilesbrowser/

2009/4/18 Barry Hunter 

>
> basically no. Google provide no method to do this.
>
> Try searching the archives, people have posted various scripts that
> can be used to help recover bits. (but dont think they can recover
> all)
>
>
>
>
> 2009/4/18 ehmo :
> >
> > Guys i did lost all my data on HDD and i want download/recovery my
> > scripts from gae back to my computer.
> >
> > It's any way how to do that? Coz i've no chance to get them back from
> > any other source.
> >
> > Thnx for help
> > >
> >
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Redirect all calls to appengine url to my Google Apps url

2009-04-18 Thread 风笑雪
Good article, thanks~

2009/4/18 ctran 

>
> Try this:
>
>
> http://appengine-cookbook.appspot.com/recipe/redirect-from-appspot-to-your-domain
>
> On Apr 18, 9:18 am, "richardcur...@googlemail.com"
>  wrote:
> > I know in principle how to redirect.
> >
> > The point is, all appengine python handler classes are identical for
> > both
> >
> > http://example.appspot.comandhttp://www.example.com
> >
> > So I had to check in EVERY python handler class - is the call coming
> > from example.appspot.com - if yes redirect towww.example.com. This is
> > madness.
> >
> > The question is how to globally set for all my python classes to
> > redirect this call.
> >
> > - Ricky
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: How to select a single word in stringproperty?

2009-04-18 Thread 风笑雪
You can read this document:
http://code.google.com/appengine/docs/python/datastore/queriesandindexes.html

Give you a sample code:

class M(db.Model):
  s = db.StringProperty()

class H(webapp.RequestHandler):
  def get(self):
M(s='aaa bbb ccc ddd').put()
M(s='eee ddd ccc fff').put()
M(s='eee').put()
M(s='eee ').put()
M(s='eef').put()

entities = M.all().filter('s >= ', 'eee').filter('s <= ', u'eee' +
u'\ufffd').fetch(10)
# u'\ufffd' is the largest possible Unicode character
for entity in entities:
  self.response.out.write(entity.s + '')


Result:

eee ddd ccc fff
eee
eee

2009/4/18 saintthor 

>
> entities1.strprop = "aaa bbb ccc ddd"
> entities2.strprop = "eee ddd ccc fff"
>
> using qerry or gql, HOW to select the entity with "eee" in strprop?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Can't create first application

2009-04-18 Thread 风笑雪
I can visit http://appengine.google.com/dashboard?&app_id=xxx ,and get this
message: You are not authorized to access this application.
Of course you can't create this application, but if you got this message,
that means it's not yours.

If you're redirected to http://appengine.google.com/start , you can check
your dashboard, it will show you all your applications.

Just login this url: http://appengine.google.com/

2009/4/18 ltcstyle 

>
> Hi,
>
> I have used Google App account to create google appengine project.
>
> I have been verified with the sms.
> Then I follow the link to create a new project.
> But when I finish, the new project is not created.
> At least I can't manage it.
>
> I then try to create it again. App engine display an error
> Sorry, "xxx" is not available. Application Identifiers may contain
> only numbers, lowercase letters or hyphens and must be between 6 and
> 30 characters.
>
> So I assume it is created. But I can't manage the project?
> I am also allowed to add appspot service in Google App, but still
> can't manage it.
> I also tried http://appengine.google.com/dashboard?&app_id=xxx. It
> will redirect me to http://appengine.google.com/start
>
> Please could any google guy help?
>
> Thanks
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: app.yaml - how to serve ALL files as they are..?

2009-04-18 Thread Wooble

I'd think this would work (but I haven't tried it):

- url: /
  static_dir: static

Note: this requires all of your site files to be in a subdirectory of
your application, since for a static_dir directive you need to specify
a relative directory.  I'm not sure if "static_dir: ." would work.
Try it yourself; I'm not personally interested in using app engine for
non-webapp static websites.  Seems like a waste.

On Apr 17, 10:11 am, jago  wrote:
> Hi,
>
> How do I set up the app.yaml that it uploads and serves basically all
> files as they are?
>
> jg
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] How to select a single word in stringproperty?

2009-04-18 Thread saintthor

entities1.strprop = "aaa bbb ccc ddd"
entities2.strprop = "eee ddd ccc fff"

using qerry or gql, HOW to select the entity with "eee" in strprop?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Redirect all calls to appengine url to my Google Apps url

2009-04-18 Thread ctran

Try this:

  
http://appengine-cookbook.appspot.com/recipe/redirect-from-appspot-to-your-domain

On Apr 18, 9:18 am, "richardcur...@googlemail.com"
 wrote:
> I know in principle how to redirect.
>
> The point is, all appengine python handler classes are identical for
> both
>
> http://example.appspot.comandhttp://www.example.com
>
> So I had to check in EVERY python handler class - is the call coming
> from example.appspot.com - if yes redirect towww.example.com. This is
> madness.
>
> The question is how to globally set for all my python classes to
> redirect this call.
>
> - Ricky
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Simple way to check where you app is running? (DevServer vs AppEngine)

2009-04-18 Thread Lee Olayvar
Perfect, thanks!

On Fri, Apr 17, 2009 at 7:19 PM, David Symonds  wrote:

>
> On Sat, Apr 18, 2009 at 11:20 AM, Lee Olayvar 
> wrote:
>
> > Is there a simple way to tell where your app is running? Eg, something as
> > fast as a little bool check? (__debug__ .. if that worked)
>
> import os
> is_debug = os.environ['SERVER_SOFTWARE'].startswith('Development/')
>
>
>
> Dave.
>
> >
>


-- 
Lee Olayvar

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Redirect all calls to appengine url to my Google Apps url

2009-04-18 Thread richardcur...@googlemail.com

I know in principle how to redirect.

The point is, all appengine python handler classes are identical for
both

http://example.appspot.com and http://www.example.com


So I had to check in EVERY python handler class - is the call coming
from example.appspot.com - if yes redirect to www.example.com. This is
madness.

The question is how to globally set for all my python classes to
redirect this call.

- Ricky
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Can't create first application

2009-04-18 Thread ltcstyle

Hi,

I have used Google App account to create google appengine project.

I have been verified with the sms.
Then I follow the link to create a new project.
But when I finish, the new project is not created.
At least I can't manage it.

I then try to create it again. App engine display an error
Sorry, "xxx" is not available. Application Identifiers may contain
only numbers, lowercase letters or hyphens and must be between 6 and
30 characters.

So I assume it is created. But I can't manage the project?
I am also allowed to add appspot service in Google App, but still
can't manage it.
I also tried http://appengine.google.com/dashboard?&app_id=xxx. It
will redirect me to http://appengine.google.com/start

Please could any google guy help?

Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Images API still limited to 1MB

2009-04-18 Thread Tim Hoffman

Why don't you stick the images in Picasa and just manage them through
app engine ?

Thats what I am doing

T

On Apr 18, 4:28 pm, Anuraag Agrawal  wrote:
> When App Engine raised its request size limit from 1MB to 10MB, it
> seemed like we would finally be able to use it for an image sharing
> website as while reasonably sized digital camera images over 1MB are
> very likely, it'd take an extremely professional camera image to break
> the 10MB limit, which seemed like an acceptable limit to place on a
> user's file uploads since those users are probably knowledgeable
> enough to resize the images themselves anyways.  API calls were still
> limited to 1MB, and as the examples listed on the blog post were
> memcache and datastore, it seemed to make sense since App Engine is
> probably still designed to place a 1MB limit on its datastore
> entries.   This seemed like it'd be ok since it should be possible to
> use the images API to resize any input images to less than 1MB before
> storing them in the datastore, completely acceptable for our task.
> However, after trying this and looking into some server errors, it
> seems the images API is also limited to 1MB input files (which fits
> with the 1MB limit on API calls, the fact just didn't register at
> first).  At least, that's how I'm interpreting the RequestTooLargeError
> (The request to API call images.Transform() was too large) I get when
> submitting a 1.5MB file.
>
> Is the limit on the images API by design/constraint?  I imagine image
> API calls aren't split across computers in a cluster or anything and
> are run in place, with possibly some temp memory that's cleared
> immediately, which makes having a limit smaller than the request size
> seem a little strange to me.  A 1MB limit on image files makes it hard
> to support user submitted image uploads in a practical setting.  I
> know it's possible to split the image over datastore entries just to
> store them, but we also need to be able to resize them to generate
> thumbnails, etc.
>
> And if anyone's come up with a workaround splitting the input file
> into parts to resize in parts, it'd be nice to hear.  While PNG uses
> DEFLATE and might not work, JPEG as far as I know cosine transforms
> blocks independently so it seems like it could be possible. Though
> it'd probably increase the load on the servers more than just having a
>
> >1MB API call limit.
>
> Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: URI Errors... logs?

2009-04-18 Thread Jesse Grosjean

> Be sure to check the 'request' logs. If your app returned a non-200
> response code but didn't log an error, it will not show up in the
> 'error' logs.

Thanks! I didn't realize that.

I'm guessing that it also won't log a response for 3XX errors? At
least it seems not to. Does anyone know exactly what response codes
report errors and what ones do not? Looking at my logs the error
frequency reported in the dashboard seems to correspond to 401
("Unauthorized") responses from that URL. I'm guessing that must be it
then.

Jesse
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Are you a human ?

2009-04-18 Thread Tom Wu

Hi All,

During my large database put into datastore, it shows
  Please go to
"https://www.google.com/accounts/DisplayUnlockCaptcha\n";
"and verify you are a human. Then try again.")

Yeah, I am a human.  ha ha ha!  Are you human ?


The captcha will stop my application until I unlock the captcha.

Is anyway to get my app continue without crack the captcha ?


Best Regards
Tom Wu


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: sort on _key_ out of order

2009-04-18 Thread David Symonds

On Sat, Apr 18, 2009 at 3:21 PM, David Wilson
 wrote:

> Is this expected behaviour? and thus do i need to always give a
> key_name to guarantee order? this creates scaling issues for order
> counter (which is probably why its not in order in the backend :) )

Keys are only guaranteed to be unique, not sequential or in order:
  
http://code.google.com/appengine/docs/python/datastore/keysandentitygroups.html#Paths_and_Key_Uniqueness

What is wrong with giving your models a timestamp property (with
auto_now_add=True), and sorting by that?


Dave.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Images API still limited to 1MB

2009-04-18 Thread 风笑雪
All API is limited to 1MB, not only image API.

2009/4/18 Anuraag Agrawal 

>
> When App Engine raised its request size limit from 1MB to 10MB, it
> seemed like we would finally be able to use it for an image sharing
> website as while reasonably sized digital camera images over 1MB are
> very likely, it'd take an extremely professional camera image to break
> the 10MB limit, which seemed like an acceptable limit to place on a
> user's file uploads since those users are probably knowledgeable
> enough to resize the images themselves anyways.  API calls were still
> limited to 1MB, and as the examples listed on the blog post were
> memcache and datastore, it seemed to make sense since App Engine is
> probably still designed to place a 1MB limit on its datastore
> entries.   This seemed like it'd be ok since it should be possible to
> use the images API to resize any input images to less than 1MB before
> storing them in the datastore, completely acceptable for our task.
> However, after trying this and looking into some server errors, it
> seems the images API is also limited to 1MB input files (which fits
> with the 1MB limit on API calls, the fact just didn't register at
> first).  At least, that's how I'm interpreting the RequestTooLargeError
> (The request to API call images.Transform() was too large) I get when
> submitting a 1.5MB file.
>
> Is the limit on the images API by design/constraint?  I imagine image
> API calls aren't split across computers in a cluster or anything and
> are run in place, with possibly some temp memory that's cleared
> immediately, which makes having a limit smaller than the request size
> seem a little strange to me.  A 1MB limit on image files makes it hard
> to support user submitted image uploads in a practical setting.  I
> know it's possible to split the image over datastore entries just to
> store them, but we also need to be able to resize them to generate
> thumbnails, etc.
>
> And if anyone's come up with a workaround splitting the input file
> into parts to resize in parts, it'd be nice to hear.  While PNG uses
> DEFLATE and might not work, JPEG as far as I know cosine transforms
> blocks independently so it seems like it could be possible. Though
> it'd probably increase the load on the servers more than just having a
> >1MB API call limit.
>
> Thanks.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Images API still limited to 1MB

2009-04-18 Thread Anuraag Agrawal

When App Engine raised its request size limit from 1MB to 10MB, it
seemed like we would finally be able to use it for an image sharing
website as while reasonably sized digital camera images over 1MB are
very likely, it'd take an extremely professional camera image to break
the 10MB limit, which seemed like an acceptable limit to place on a
user's file uploads since those users are probably knowledgeable
enough to resize the images themselves anyways.  API calls were still
limited to 1MB, and as the examples listed on the blog post were
memcache and datastore, it seemed to make sense since App Engine is
probably still designed to place a 1MB limit on its datastore
entries.   This seemed like it'd be ok since it should be possible to
use the images API to resize any input images to less than 1MB before
storing them in the datastore, completely acceptable for our task.
However, after trying this and looking into some server errors, it
seems the images API is also limited to 1MB input files (which fits
with the 1MB limit on API calls, the fact just didn't register at
first).  At least, that's how I'm interpreting the RequestTooLargeError
(The request to API call images.Transform() was too large) I get when
submitting a 1.5MB file.

Is the limit on the images API by design/constraint?  I imagine image
API calls aren't split across computers in a cluster or anything and
are run in place, with possibly some temp memory that's cleared
immediately, which makes having a limit smaller than the request size
seem a little strange to me.  A 1MB limit on image files makes it hard
to support user submitted image uploads in a practical setting.  I
know it's possible to split the image over datastore entries just to
store them, but we also need to be able to resize them to generate
thumbnails, etc.

And if anyone's come up with a workaround splitting the input file
into parts to resize in parts, it'd be nice to hear.  While PNG uses
DEFLATE and might not work, JPEG as far as I know cosine transforms
blocks independently so it seems like it could be possible. Though
it'd probably increase the load on the servers more than just having a
>1MB API call limit.

Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Redirect all calls to appengine url to my Google Apps url

2009-04-18 Thread 风笑雪
Sorry
class Handler(webapp.RequestHandler):
  def get(self):
self.set_status(301)
self.redirect("http://www.example.com";) # this is what you want to
redirect to

2009/4/18 风笑雪 

> class Handler(webapp.RequestHandler):
>   def get(self):
> self.set_status(301)
> self.redirect("/home")
>
> and make Handler class to handle your url.
>
> 2009/4/18 richardcur...@googlemail.com 
>
>
>> Hi,
>>
>> how do I somehow 'redirect' all calls to appengine url to my Google
>> Apps url?
>>
>> Something like: (Status-Line)   HTTP/1.1 301 Moved Permanently
>>
>>
>>
>> if somebody calls:
>>
>> http://example.appspot.com I want it to be redirected to
>>
>> http://www.example.com
>>
>>
>> similarily if somebody calls
>>
>> http://example.appspot.com/data/34354/fractal
>>
>> I want the browser of the user show http://example.com/data/34354/fractal
>> >>
>>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Redirect all calls to appengine url to my Google Apps url

2009-04-18 Thread 风笑雪
class Handler(webapp.RequestHandler):
  def get(self):
self.set_status(301)
self.redirect("/home")

and make Handler class to handle your url.

2009/4/18 richardcur...@googlemail.com 

>
> Hi,
>
> how do I somehow 'redirect' all calls to appengine url to my Google
> Apps url?
>
> Something like: (Status-Line)   HTTP/1.1 301 Moved Permanently
>
>
>
> if somebody calls:
>
> http://example.appspot.com I want it to be redirected to
>
> http://www.example.com
>
>
> similarily if somebody calls
>
> http://example.appspot.com/data/34354/fractal
>
> I want the browser of the user show http://example.com/data/34354/fractal
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Performance issues

2009-04-18 Thread Eric Walker

Thanks for the suggestion.  I'll try #3 as an first approach and see
where that takes me (and look forward to #5).  I think app-engine-
patch has a main() declared, and I assume the app is getting cached as
a result, but I'm not sure if that's the case.

Re the file caching idea, I don't understand the present environment
enough to do more than guess about how this might be done, so this is
just brainstorming.

I assume that there are two different factors that are going into the
longer request times that I've been seeing in my own case.  There's
the zipimporter call, which decompresses the Django 1.0 archive that I
keep in a subdirectory of my app.  I imagine this takes a while each
time it happens, and it might account for much of the request time.
Since zipimporter isn't called with every request and some requests
are pretty quick, I assume in those instances I'm hitting a server on
which the needed python symbols were resolved during a previous
request.  Hence the application was probably memory resident, and the
zipimporter call wasn't needed.  In other instances it's possible that
the application had to be reloaded from the network, which might
account any time above that necessary for the zipimporter call.

If I remember correctly, the reason the Django files are being
archived is that there's a 1000 file limit on what can be uploaded (in
a single upload?).  Using an archive instead of an uncompressed
directory is a way to get around this limit.

What I had in mind in the postscript was something like a distributed,
shared memory for the cloud as a whole that doesn't know or care about
the actual data that is being shared (python or Java files) or where
it comes from (application developers).  If 1000 applications request
a file often enough (e.g., a core Django library file), it would be
pushed out to the servers in such a way that symbols could be loaded
by the python interpreter from memory rather than from a file on disk
or over the network.  We would know how often a file was being
requested by taking a strong cryptographic checksum of the contents of
each file in an application the first time an open() system call is
called on the file after a new version of the application has been
uploaded.  Perhaps such an open() call would happen during a python
import.  Once the checksum has been obtained, the usage of the file
could then be tracked across applications and across requests, and it
could be checked against a large table of checksums on which
statistics are being maintained.  Although some of this might happen
during the request, I think a lot of it could be deferred until
later.  Since we're working at a pretty low level, hopefully it
wouldn't matter if the original source of a file was an archive rather
than an uncompressed directory; one issue, though, is that the
uncompressed files from an archive will obviously be (much) larger
than the archive itself and will require more memory.  The problem
with making use of the archive itself is that the zipimporter call
seems to cost a lot, but perhaps it is small compared to a network
call.

In this setup, if 1000 applications use a common subset of Django
files (0.96, 1.0 or whatever), the total server memory across the
cloud devoted to those files at any given time wouldn't necessarily be
less than in the current setup, since some or all of the subset will
have been pushed out.  But it wouldn't be necessary to push out a
single application in its entirety as often, since some of the files
might already be in memory.  I'm not sure how this would affect other
applications, e.g., how much it would reduce the need to recycle
memory currently being used for other applications when there is a new
request.  But hopefully it would result in a more efficient use of
existing resources.  There would be an incentive for people to use the
same libraries so that their applications would be more responsive,
and perhaps a pricing signal could be devised that would encourage
this.

There would be a need to ensure that the files that are understood to
be shared really are the same files, so that someone isn't able to
inject a malicious file that is then used by a number of other
applications.  If A uploads a common file that is profiled and then
gets pushed out and B's application is to make use of it, it would be
important for A's version of the file to be the same as B's version,
so that B's application isn't compromised.  I was thinking that a
strong cryptographic checksum might be adequate for this, but I'm sure
there are challenges I'm not aware of.  Something like MD5 probably
wouldn't be suitable, since I understand there are ways to make
different files that have the same MD5 hash.  Perhaps including a
check of the file size would be enough.  Computation time needed to
derive the hash would be an important factor.

You guys are obviously facing a pretty challenging problem.  Best of
luck in this regard.

Eric


On Apr 16, 2:49 pm, "Jeff S (Google)"  wro

[google-appengine] Re: Newbie First Upload Problems

2009-04-18 Thread 风笑雪
No need change your code, just change your app.yaml like below:
- url: /.*
  script: main.py
  login: admin

2009/4/18 codingJoe 

>
> I'll tell the newbie story on how I got into this mess.
>
> I developed a small app and tested on my laptop using the AppEngine
> SDK.  I got my app to point that it was working the way I wanted.
> Now, I'm ready to test it online.   I'm a perfectionist about some
> things, so I don't want to public to see my app until I've
> thoroughally tested it online.
>
> In order to build my little staging area, I restricted the app to my
> group's domain-name.  I uploaded it and the first couple screens
> seemed to work.  Then I clicked on some of the user functions and
> things started to break.  Here's my errors.   Can someone help me
> understand what's going on here?  I'm beginning to get confused.
>
>
>  'login_url' : users.CreateLoginURL(self.request.uri),
>  File "/base/python_lib/versions/1/google/appengine/api/users.py",
> line 176, in create_login_url
>raise NotAllowedError
> NotAllowedError
>
>
> I start commenting things out to try my app without logins.  And Now
> every time I access usernames I get errors with None type.
>
> Advice?   how do I fix this?  What steps to troubleshoot?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---