[google-appengine] Re: Announcing SSL for Custom Domains Trusted Tester Program
On Oct 20, 10:33 pm, Brandon Wirtz drak...@digerat.com wrote: IE5/IE6 will say page cannot be displayed and will never connect. For this reason you should encourage users to arrive at a non-HTTPs version of the page, do browser detection and display an Upgrade your browser notification, then use the login to take them to the secure version of the site. According to Wikipedia ALL Internet Explorer and safari browsers on Windows XP do not have SNI support. And strangly enough Google Chrome's versions below 6 do not have it either(a tiny percentage). So we are supposed to detect them all using the useragent string? That would be fun to try... But we all knew that before we started asking for SNI, so great job Google and the App Engine developers! -- 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 SSL for Custom Domains Trusted Tester Program
Also it is very worth noting that SNI is not supported in Python versions below 3.2 -- 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: send_blob() and Content-Length header?!
Either way you couldn't set the Content-Length header even if you wanted to. GAE automatically sets the Content-Length for all requests. On Sep 30, 8:56 pm, andreas schmid a.schmi...@gmail.com wrote: hi, im wondering if the send_blob() function sends out a Content-Length header value with the response. wasn't able to figure it out. please let me know if this is the case and if it does not how can i set it manually? thx -- 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: Why won't any of my posts appear in the Google App Engine Python Group?
Thanks, why would we get spam moderated? we didn't do anything wrong, I maybe posted two posts at the same day, but they were totally different. Is there a way to bring back my posts or something? Thanks. On 24 מרץ, 23:56, Ikai Lan i...@google.com wrote: You guys were getting spam moderated. I've whitelisted you both. On Wed, Mar 24, 2010 at 1:31 PM, Scott Southworth scott.southwo...@gmail.com wrote: I had the same problem when posting to the Python group. I gave up and only post to the main group now... On Wed, Mar 24, 2010 at 2:53 PM, Shedokan shedok...@gmail.com wrote: I have in the last week posted about three unique posts in the Google App Engine Python Group about different questions that I had but somehow none of those are showing in the group and when I search for them they appear to have dissappeared. What's the problem? 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-appeng...@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. -- 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-appeng...@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. -- Ikai Lan Developer Programs Engineer, Google App Enginehttp://googleappengine.blogspot.com|http://twitter.com/app_engine -- 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-appeng...@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: Why won't any of my posts appear in the Google App Engine Python Group?
I understand it wasn't intentional, and that it was automatic, but I hope it won't happen to anyone else, because I know how frustrating it is. Thanks for clearing it out. On 25 מרץ, 22:10, Ikai L (Google) ika...@google.com wrote: It wasn't intentional and was done automatically. In your cases, you were false positives. For both the main group and Java group we spam moderate all new members. This isn't enabled by the Python group. Instead, we let in all members. Our spam detection service may mark messages as spam and keep the developers in limbo until we can clear it out. On Thu, Mar 25, 2010 at 12:02 PM, Shedokan shedok...@gmail.com wrote: Thanks, why would we get spam moderated? we didn't do anything wrong, I maybe posted two posts at the same day, but they were totally different. Is there a way to bring back my posts or something? Thanks. On 24 מרץ, 23:56, Ikai Lan i...@google.com wrote: You guys were getting spam moderated. I've whitelisted you both. On Wed, Mar 24, 2010 at 1:31 PM, Scott Southworth scott.southwo...@gmail.com wrote: I had the same problem when posting to the Python group. I gave up and only post to the main group now... On Wed, Mar 24, 2010 at 2:53 PM, Shedokan shedok...@gmail.com wrote: I have in the last week posted about three unique posts in the Google App Engine Python Group about different questions that I had but somehow none of those are showing in the group and when I search for them they appear to have dissappeared. What's the problem? 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-appeng...@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. -- 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-appeng...@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. -- Ikai Lan Developer Programs Engineer, Google App Enginehttp://googleappengine.blogspot.com|http://twitter.com/app_engine -- 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-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/google-appengine?hl=en. -- Ikai Lan Developer Programs Engineer, Google App Enginehttp://googleappengine.blogspot.com|http://twitter.com/app_engine -- 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-appeng...@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] Why won't any of my posts appear in the Google App Engine Python Group?
I have in the last week posted about three unique posts in the Google App Engine Python Group about different questions that I had but somehow none of those are showing in the group and when I search for them they appear to have dissappeared. What's the problem? 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-appeng...@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: Is it possible to change a datastore object key name after it was created?
Ok, thanks, I was thinking of that as my plan b. On 11 מרץ, 21:58, Eli Jones eli.jo...@gmail.com wrote: You cannot change the key_name for an entity.. At best, you could put a new entity into the datastore using the new key_name and the old entities properties.. and just delete the old entity. On Thu, Mar 11, 2010 at 2:55 PM, Shedokan shedok...@gmail.com wrote: In my app I create an object and put it into the datastore with a custom key_name based on other properties of the object for getting it from the datastore faster. what happens if I want to change later on the key name? 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-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.comgoogle-appengine%2Bunsubscrib e...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en. -- 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-appeng...@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: Why request time for script takes so long?
I think I forgot to mention that my app is a python app and not a java app. But somehow now eveything is alright, maybe it's because I haven't used GAE for a long time. but thanks for trying. On 6 מרץ, 20:10, François Masurel fm2...@mably.com wrote: You should have a look at the following issues : http://code.google.com/p/googleappengine/issues/detail?id=2456http://code.google.com/p/googleappengine/issues/detail?id=2690 And star them if you want. François On 6 mar, 17:05, Shedokan shedok...@gmail.com wrote: Hi, I live in israel and I'm making an app in app engine. When I go tomy app it takes about 5 seconds for it to load, and I have checked if it's my app that slowing things down and my app takes only half a second of all that time. so what's making my app slow? 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-appeng...@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: Why should I use self.response.out.write?
Thanks, I didn't think of that probably because I'm new to python. But if I would want to get all files and folders in a path then I woul get them by path and name instead of by key, right? On 30 מאי, 15:16, David Wilson d...@botanicus.net wrote: 2009/5/29 Shedokan shedok...@gmail.com: TO make things faster I made two Classes: this one for the basic file or folder info: class Object(db.Model): name = db.StringProperty(multiline=False) path = db.StringProperty(multiline=False) type = db.StringProperty(multiline=False) info = db.StringProperty(multiline=False) created = db.DateTimeProperty(auto_now_add=True) changed = db.DateTimeProperty(auto_now_add=True) and this one for the content of the file: class ObjectContent(db.Model): name = db.StringProperty(multiline=False) path = db.StringProperty(multiline=False) contents = db.BlobProperty() That way when I'm getting only the files info i don't have to get all of it's content. And I am getting files like this: db.GqlQuery('SELECT * FROM Object WHERE name= :1 AND path= : 2',name,path) This makes use of a composite index when you don't need to. Index access adds around 100ms extra to each Datastore access (see [0] and [1] below). Instead of using an index on (path, name), you can use a key_name composed of the path and name. Something like: key_name = 'X' + path + name object_entity = Object(key_name=key_name, ...) content_entity = ObjectContent(key_name=key_name, contents=contents) db.put([ object_entity, content_entity ]) Then to query: entity = ObjectContent.get_by_key_name(key_name) Note prefixing the key_name with an 'X', to avoid an error if the path starts with a number. You should also ensure that no distinct combination of (path, name) will ever lead to the same key_name. If it can in your application, separate the path and name with some character that never appears in a path. This is to prevent ambiguous key_names from being generated, e.g.: path, name = '/my/site/', 'foo' bad_key_name = '/my/site/foo' - ambiguous better_key_name = '/my/site/|foo' path, name = '/my/', 'site/foo' bad_key_name = '/my/site/foo' - ambiguous better_key_name = '/my/|site/foo' You can save yet more time by fetching the Object and the ObjectContent simultaneously: object_entity, content_entity = db.get([ db.Key.from_path('Object', key_name), db.Key.from_path('ObjectContent, key_name) ]) [0]http://code.google.com/status/appengine/detail/datastore/2009/05/23#a... [1]http://code.google.com/status/appengine/detail/datastore/2009/05/23#a... and I list all files in a folder like this: db.GqlQuery('SELECT * FROM Object WHERE path= :1',path) if only I could select parts of the file and not all of the info like SQL: SELECT name, PATH from ... On 29 מאי, 17:19, David Wilson d...@botanicus.net wrote: Hey Shedokan, Are you fetching your files from Datastore in a batch, or one at a time? data = [] for filename in ['a', 'b', 'c']: data.append(SomeModel.get_by_key_name(filename)) Is significantly slower than: keys = [ db.Key.from_path('SomeModel', fn) for fn in [ 'a', 'b', 'c' ] ] data = db.get(keys) 2009/5/29 Shedokan shedok...@gmail.com: Thanks, I am worried because I am trying to optimize my app to be almost as fast as the php version. usualy it takes 250ms for an ajax request(firebug) in the php version and 500ms in the python version so python is two times slower than the php version. but I guess it's because I have to store the files in the datastore and not in real directories. well thanks anyway. On 29 מאי, 04:32, David Wilson d...@botanicus.net wrote: Just assume that any string/list/hash/integer-related operations in Python are likely faster than you'll ever need them to be. The overhead for buffering the response is going to be tiny regardless of your application, since at most you're only talking about handling strings of up to 10mb (which is the request size limit). If there is anything with AppEngine you need to be careful of, it is use of Datastore, where reading/writing large numbers of entities will cost a lot of performance. Reducing your Datastore use by a single db.get() is equal to thousands of calls to self.response.out.write() $ python /usr/lib/python2.5/timeit.py -v -s 'from cStringIO import StringIO; out = StringIO()' 'out.write(123)' 1 loops - 0.00373 secs 10 loops - 0.0383 secs 100 loops - 0.365 secs raw times: 0.358 0.358 0.357 100 loops, best of 3: 0.357 usec per loop $ ae Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type help, copyright, credits or license for more information. (AppEngineShell) import time t1
[google-appengine] Re: Why should I use self.response.out.write?
Ok thank you very much, I'm going to try different things to see which will be faster and go with it. By the way it's for an online os I'm making. startup is about half a second on google's servers and 90ms on my computer. Thanks. On 30 מאי, 21:30, David Wilson d...@botanicus.net wrote: Correct.. fetching by key_name obviously will only work when you know the exactly key you want. :) Otherwise it needs to be a Query. 2009/5/30 Shedokan shedok...@gmail.com: Thanks, I didn't think of that probably because I'm new to python. But if I would want to get all files and folders in a path then I woul get them by path and name instead of by key, right? On 30 מאי, 15:16, David Wilson d...@botanicus.net wrote: 2009/5/29 Shedokan shedok...@gmail.com: TO make things faster I made two Classes: this one for the basic file or folder info: class Object(db.Model): name = db.StringProperty(multiline=False) path = db.StringProperty(multiline=False) type = db.StringProperty(multiline=False) info = db.StringProperty(multiline=False) created = db.DateTimeProperty(auto_now_add=True) changed = db.DateTimeProperty(auto_now_add=True) and this one for the content of the file: class ObjectContent(db.Model): name = db.StringProperty(multiline=False) path = db.StringProperty(multiline=False) contents = db.BlobProperty() That way when I'm getting only the files info i don't have to get all of it's content. And I am getting files like this: db.GqlQuery('SELECT * FROM Object WHERE name= :1 AND path= : 2',name,path) This makes use of a composite index when you don't need to. Index access adds around 100ms extra to each Datastore access (see [0] and [1] below). Instead of using an index on (path, name), you can use a key_name composed of the path and name. Something like: key_name = 'X' + path + name object_entity = Object(key_name=key_name, ...) content_entity = ObjectContent(key_name=key_name, contents=contents) db.put([ object_entity, content_entity ]) Then to query: entity = ObjectContent.get_by_key_name(key_name) Note prefixing the key_name with an 'X', to avoid an error if the path starts with a number. You should also ensure that no distinct combination of (path, name) will ever lead to the same key_name. If it can in your application, separate the path and name with some character that never appears in a path. This is to prevent ambiguous key_names from being generated, e.g.: path, name = '/my/site/', 'foo' bad_key_name = '/my/site/foo' - ambiguous better_key_name = '/my/site/|foo' path, name = '/my/', 'site/foo' bad_key_name = '/my/site/foo' - ambiguous better_key_name = '/my/|site/foo' You can save yet more time by fetching the Object and the ObjectContent simultaneously: object_entity, content_entity = db.get([ db.Key.from_path('Object', key_name), db.Key.from_path('ObjectContent, key_name) ]) [0]http://code.google.com/status/appengine/detail/datastore/2009/05/23#a... [1]http://code.google.com/status/appengine/detail/datastore/2009/05/23#a... and I list all files in a folder like this: db.GqlQuery('SELECT * FROM Object WHERE path= :1',path) if only I could select parts of the file and not all of the info like SQL: SELECT name, PATH from ... On 29 מאי, 17:19, David Wilson d...@botanicus.net wrote: Hey Shedokan, Are you fetching your files from Datastore in a batch, or one at a time? data = [] for filename in ['a', 'b', 'c']: data.append(SomeModel.get_by_key_name(filename)) Is significantly slower than: keys = [ db.Key.from_path('SomeModel', fn) for fn in [ 'a', 'b', 'c' ] ] data = db.get(keys) 2009/5/29 Shedokan shedok...@gmail.com: Thanks, I am worried because I am trying to optimize my app to be almost as fast as the php version. usualy it takes 250ms for an ajax request(firebug) in the php version and 500ms in the python version so python is two times slower than the php version. but I guess it's because I have to store the files in the datastore and not in real directories. well thanks anyway. On 29 מאי, 04:32, David Wilson d...@botanicus.net wrote: Just assume that any string/list/hash/integer-related operations in Python are likely faster than you'll ever need them to be. The overhead for buffering the response is going to be tiny regardless of your application, since at most you're only talking about handling strings of up to 10mb (which is the request size limit). If there is anything with AppEngine you need to be careful of, it is use of Datastore, where reading/writing large numbers of entities will cost a lot of performance. Reducing your Datastore use by a single db.get
[google-appengine] Re: Why should I use self.response.out.write?
Thanks, I am worried because I am trying to optimize my app to be almost as fast as the php version. usualy it takes 250ms for an ajax request(firebug) in the php version and 500ms in the python version so python is two times slower than the php version. but I guess it's because I have to store the files in the datastore and not in real directories. well thanks anyway. On 29 מאי, 04:32, David Wilson d...@botanicus.net wrote: Just assume that any string/list/hash/integer-related operations in Python are likely faster than you'll ever need them to be. The overhead for buffering the response is going to be tiny regardless of your application, since at most you're only talking about handling strings of up to 10mb (which is the request size limit). If there is anything with AppEngine you need to be careful of, it is use of Datastore, where reading/writing large numbers of entities will cost a lot of performance. Reducing your Datastore use by a single db.get() is equal to thousands of calls to self.response.out.write() $ python /usr/lib/python2.5/timeit.py -v -s 'from cStringIO import StringIO; out = StringIO()' 'out.write(123)' 1 loops - 0.00373 secs 10 loops - 0.0383 secs 100 loops - 0.365 secs raw times: 0.358 0.358 0.357 100 loops, best of 3: 0.357 usec per loop $ ae Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type help, copyright, credits or license for more information. (AppEngineShell) import time t1 = time.time() ; db.get(db.Key.from_path('Foo', 1234)) ; print (time.time()-t1)*1000 12.839233 David. 2009/5/29 Shedokan shedok...@gmail.com: Thanks, but does self.response.out affects speed very much? I couldn't benchmark it, strange... On 28 מאי, 22:25, David Wilson d...@botanicus.net wrote: Using self.response.out will also delay sending your entire response until it is sure to succeed. If you start generating output using 'print', and then e.g. a Datastore request times out, or a bug in your code is triggered, you have no chance to display a friendly error message. Instead the user will get a half-rendered page with a stack trace embedded in it, or worse. David. 2009/5/28 Shedokan shedok...@gmail.com: so I can't print binary data like Images? On 28 מאי, 21:03, 风笑雪 kea...@gmail.com wrote: Print is also OK, but you need handle header by yourself, and it can only output text.http://code.google.com/intl/en/appengine/docs/python/gettingstarted/h... print 'Content-Type: text/plain' print '' print 'Hello, world!' 2009/5/29 Shedokan shedok...@gmail.com I am wondering why should I use self.response.out.write and not print everything. because I am making this app where I have to output from a lot ofdifferent functions and I am passing the object 'self' everywhere. thanks. -- It is better to be wrong than to be vague. — Freeman Dyson -- It is better to be wrong than to be vague. — Freeman Dyson --~--~-~--~~~---~--~~ 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: Why should I use self.response.out.write?
TO make things faster I made two Classes: this one for the basic file or folder info: class Object(db.Model): name = db.StringProperty(multiline=False) path = db.StringProperty(multiline=False) type = db.StringProperty(multiline=False) info = db.StringProperty(multiline=False) created = db.DateTimeProperty(auto_now_add=True) changed = db.DateTimeProperty(auto_now_add=True) and this one for the content of the file: class ObjectContent(db.Model): name = db.StringProperty(multiline=False) path = db.StringProperty(multiline=False) contents = db.BlobProperty() That way when I'm getting only the files info i don't have to get all of it's content. And I am getting files like this: db.GqlQuery('SELECT * FROM Object WHERE name= :1 AND path= : 2',name,path) and I list all files in a folder like this: db.GqlQuery('SELECT * FROM Object WHERE path= :1',path) if only I could select parts of the file and not all of the info like SQL: SELECT name, PATH from ... On 29 מאי, 17:19, David Wilson d...@botanicus.net wrote: Hey Shedokan, Are you fetching your files from Datastore in a batch, or one at a time? data = [] for filename in ['a', 'b', 'c']: data.append(SomeModel.get_by_key_name(filename)) Is significantly slower than: keys = [ db.Key.from_path('SomeModel', fn) for fn in [ 'a', 'b', 'c' ] ] data = db.get(keys) 2009/5/29 Shedokan shedok...@gmail.com: Thanks, I am worried because I am trying to optimize my app to be almost as fast as the php version. usualy it takes 250ms for an ajax request(firebug) in the php version and 500ms in the python version so python is two times slower than the php version. but I guess it's because I have to store the files in the datastore and not in real directories. well thanks anyway. On 29 מאי, 04:32, David Wilson d...@botanicus.net wrote: Just assume that any string/list/hash/integer-related operations in Python are likely faster than you'll ever need them to be. The overhead for buffering the response is going to be tiny regardless of your application, since at most you're only talking about handling strings of up to 10mb (which is the request size limit). If there is anything with AppEngine you need to be careful of, it is use of Datastore, where reading/writing large numbers of entities will cost a lot of performance. Reducing your Datastore use by a single db.get() is equal to thousands of calls to self.response.out.write() $ python /usr/lib/python2.5/timeit.py -v -s 'from cStringIO import StringIO; out = StringIO()' 'out.write(123)' 1 loops - 0.00373 secs 10 loops - 0.0383 secs 100 loops - 0.365 secs raw times: 0.358 0.358 0.357 100 loops, best of 3: 0.357 usec per loop $ ae Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type help, copyright, credits or license for more information. (AppEngineShell) import time t1 = time.time() ; db.get(db.Key.from_path('Foo', 1234)) ; print (time.time()-t1)*1000 12.839233 David. 2009/5/29 Shedokan shedok...@gmail.com: Thanks, but does self.response.out affects speed very much? I couldn't benchmark it, strange... On 28 מאי, 22:25, David Wilson d...@botanicus.net wrote: Using self.response.out will also delay sending your entire response until it is sure to succeed. If you start generating output using 'print', and then e.g. a Datastore request times out, or a bug in your code is triggered, you have no chance to display a friendly error message. Instead the user will get a half-rendered page with a stack trace embedded in it, or worse. David. 2009/5/28 Shedokan shedok...@gmail.com: so I can't print binary data like Images? On 28 מאי, 21:03, 风笑雪 kea...@gmail.com wrote: Print is also OK, but you need handle header by yourself, and it can only output text.http://code.google.com/intl/en/appengine/docs/python/gettingstarted/h... print 'Content-Type: text/plain' print '' print 'Hello, world!' 2009/5/29 Shedokan shedok...@gmail.com I am wondering why should I use self.response.out.write and not print everything. because I am making this app where I have to output from a lot ofdifferent functions and I am passing the object 'self' everywhere. thanks. -- It is better to be wrong than to be vague. — Freeman Dyson -- It is better to be wrong than to be vague. — Freeman Dyson -- It is better to be wrong than to be vague. — Freeman Dyson --~--~-~--~~~---~--~~ 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
[google-appengine] Why should I use self.response.out.write?
I am wondering why should I use self.response.out.write and not print everything. because I am making this app where I have to output from a lot ofdifferent functions and I am passing the object 'self' everywhere. 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: Why should I use self.response.out.write?
so I can't print binary data like Images? On 28 מאי, 21:03, 风笑雪 kea...@gmail.com wrote: Print is also OK, but you need handle header by yourself, and it can only output text.http://code.google.com/intl/en/appengine/docs/python/gettingstarted/h... print 'Content-Type: text/plain' print '' print 'Hello, world!' 2009/5/29 Shedokan shedok...@gmail.com I am wondering why should I use self.response.out.write and not print everything. because I am making this app where I have to output from a lot ofdifferent functions and I am passing the object 'self' everywhere. 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: Why should I use self.response.out.write?
Thanks, but does self.response.out affects speed very much? I couldn't benchmark it, strange... On 28 מאי, 22:25, David Wilson d...@botanicus.net wrote: Using self.response.out will also delay sending your entire response until it is sure to succeed. If you start generating output using 'print', and then e.g. a Datastore request times out, or a bug in your code is triggered, you have no chance to display a friendly error message. Instead the user will get a half-rendered page with a stack trace embedded in it, or worse. David. 2009/5/28 Shedokan shedok...@gmail.com: so I can't print binary data like Images? On 28 מאי, 21:03, 风笑雪 kea...@gmail.com wrote: Print is also OK, but you need handle header by yourself, and it can only output text.http://code.google.com/intl/en/appengine/docs/python/gettingstarted/h... print 'Content-Type: text/plain' print '' print 'Hello, world!' 2009/5/29 Shedokan shedok...@gmail.com I am wondering why should I use self.response.out.write and not print everything. because I am making this app where I have to output from a lot ofdifferent functions and I am passing the object 'self' everywhere. thanks. -- It is better to be wrong than to be vague. — Freeman Dyson --~--~-~--~~~---~--~~ 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: Static files expire immediately?
Thanks, next time I should read the documentation first. On 23 מאי, 12:18, Kjartan kjartansverris...@gmail.com wrote: You can define the expiration time for static files application wide using default_expiration handler in app.yaml. You may also use the expiration handler for static directories. See more here:http://code.google.com/appengine/docs/python/config/appconfig.html Cheers, Kjartan S. On May 22, 4:41 pm, Shedokan shedok...@gmail.com wrote: Why does google app engine sets the expiry date of static files to the time they were downloaded? that doesn't let's the browser cache the files. --~--~-~--~~~---~--~~ 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] Static files expire immediately?
Why does google app engine sets the expiry date of static files to the time they were downloaded? that doesn't let's the browser cache the files. --~--~-~--~~~---~--~~ 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: 411 length required on POST error - Content-length header specified
Here's my main.py file: from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app class startUp(webapp.RequestHandler): def get(self): # execute something that executes the ajax post request class handleAjax(webapp.RequestHandler): def get(self): # This works self.response.out.write('hello') def post(self): # I also tryed this without success #self.response.headers['Content-Length'] = len(res) self.response.out.write('hello') def main(): system = webapp.WSGIApplication([ ('/', startUp), ('/ajax', handleAjax), ]) run_wsgi_app(system) if __name__ == __main__: main() On 5 מאי, 01:28, Jason (Google) apija...@google.com wrote: It sounds like you're using the URL Fetch service. Can you share your code which executes the POST request? - Jason On Thu, Apr 30, 2009 at 6:00 PM, Shedokan shedok...@gmail.com wrote: I have my app here: http://shedokan-os.appspot.com/ at the start of the app it sends a post request to the server. and instead of giving the content it supposed to it gives out the error POST requests require a Content-length header. and I did specify that kind of header. what's wrong? --~--~-~--~~~---~--~~ 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: 411 length required on POST error - Content-length header specified
I used jquery's post function instead of ajax and it worked, but it's not a solution because I can't set if he post fails. On 13 מאי, 13:18, Shedokan shedok...@gmail.com wrote: Here's my main.py file: from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app class startUp(webapp.RequestHandler): def get(self): # execute something that executes the ajax post request class handleAjax(webapp.RequestHandler): def get(self): # This works self.response.out.write('hello') def post(self): # I also tryed this without success #self.response.headers['Content-Length'] = len(res) self.response.out.write('hello') def main(): system = webapp.WSGIApplication([ ('/', startUp), ('/ajax', handleAjax), ]) run_wsgi_app(system) if __name__ == __main__: main() On 5 מאי, 01:28, Jason (Google) apija...@google.com wrote: It sounds like you're using the URL Fetch service. Can you share your code which executes the POST request? - Jason On Thu, Apr 30, 2009 at 6:00 PM, Shedokan shedok...@gmail.com wrote: I have my app here: http://shedokan-os.appspot.com/ at the start of the app it sends a post request to the server. and instead of giving the content it supposed to it gives out the error POST requests require a Content-length header. and I did specify that kind of header. what's wrong? --~--~-~--~~~---~--~~ 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: store files to datastore in a folder like structure?
No, I mean the content of a file so if it's a text file then it'll contain text. I found this to add to the File class: contents = db.BlobProperty() and this when I set it: file.contents = db.Blob(content) but when I retrive it from the data store I can't find a way to get the value. And for the os like folder and file structure, wouldn't it be better to store the path of the folder to the data store instead of saving only the parents key? because if I would want to get a file with this path: Folder/Folder 2/File.txt then I would just search for a file named File.txt with a path Folder/ Folder 2, instead of searching for a folder called Folder and the searching in it for a folder named Folder 2 and then searching in it a file named File.txt. just want your opinion because you all clearly have much more experience than me with database structure etc. On 7 מאי, 16:26, slink3r slin...@gmail.com wrote: A blob with a key pointing back to the folder -Brian On May 6, 8:00 am, Shedokan shedok...@gmail.com wrote: Tim: I don't quite understand most of what you said because I kinda really new to python programming I know only php and python, but what I do understand I will try to do. What type do you people suggest I'll use for the file content? On 6 מאי, 06:16, Pranav Prakash pra...@gmail.com wrote: class Folder(db.Model): name = db.StringProperty() subfolders = db.ListProperty(File) parent = db.SelfReferenceProperty() This is how folder can be implemented. A folder must know what all files are child. Also a folder must know the parent folder (folders in case of cyclic dir structure). Apart from this, you might also implement Linux inode system in a model, for book keeping. On May 6, 5:41 am, Tim Hoffman zutes...@gmail.com wrote: You will need to create a Folder entity It will need to know it's children, and you will need to support some form of url traversability to walk the folder heirarchy. I am doing that with zope3 components on gae Django doesn't normally do url traversing, but has a regex match to method Do you really need a folder heirarchy, have you gone down that path because you are just trying to replicate a filesystem, with out really needing those semantics ? If you really want this sort of functionality you might want to look at repoze.bfg it is just been made useable under gae (and is zope 3 based though much simpler) and does support inherintly the notion of url traversal over an object model/graph Rgds T On May 6, 6:34 am, Shedokan shedok...@gmail.com wrote: I am porting my WebOS(Shedokan OS) to python from php so I can use it og GAE and I came to the stage where I need to read and write files. And after a lot of searching I found out that I cannot create files or write to files. here is my code: from google.appengine.ext import db class File(db.Model): filename = db.StringProperty(multiline=False) filedata = db.BlobProperty date = db.DateTimeProperty(auto_now_add=True) def createFile(fileName, content): if fileName=='' or content=='': return file = File() file.filedata = content file.filename = fileName file.put() def getFile(fileName): if fileName=='': return return db.GqlQuery('SELECT * FROM File WHERE filename= :1',fileName) any way to make this work with a folder structure? also I want to note that I started learning python just about 3 days ago, so I think I'm a begginer. 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: store files to datastore in a folder like structure?
Tim: I don't quite understand most of what you said because I kinda really new to python programming I know only php and python, but what I do understand I will try to do. What type do you people suggest I'll use for the file content? On 6 מאי, 06:16, Pranav Prakash pra...@gmail.com wrote: class Folder(db.Model): name = db.StringProperty() subfolders = db.ListProperty(File) parent = db.SelfReferenceProperty() This is how folder can be implemented. A folder must know what all files are child. Also a folder must know the parent folder (folders in case of cyclic dir structure). Apart from this, you might also implement Linux inode system in a model, for book keeping. On May 6, 5:41 am, Tim Hoffman zutes...@gmail.com wrote: You will need to create a Folder entity It will need to know it's children, and you will need to support some form of url traversability to walk the folder heirarchy. I am doing that with zope3 components on gae Django doesn't normally do url traversing, but has a regex match to method Do you really need a folder heirarchy, have you gone down that path because you are just trying to replicate a filesystem, with out really needing those semantics ? If you really want this sort of functionality you might want to look at repoze.bfg it is just been made useable under gae (and is zope 3 based though much simpler) and does support inherintly the notion of url traversal over an object model/graph Rgds T On May 6, 6:34 am, Shedokan shedok...@gmail.com wrote: I am porting my WebOS(Shedokan OS) to python from php so I can use it og GAE and I came to the stage where I need to read and write files. And after a lot of searching I found out that I cannot create files or write to files. here is my code: from google.appengine.ext import db class File(db.Model): filename = db.StringProperty(multiline=False) filedata = db.BlobProperty date = db.DateTimeProperty(auto_now_add=True) def createFile(fileName, content): if fileName=='' or content=='': return file = File() file.filedata = content file.filename = fileName file.put() def getFile(fileName): if fileName=='': return return db.GqlQuery('SELECT * FROM File WHERE filename= :1',fileName) any way to make this work with a folder structure? also I want to note that I started learning python just about 3 days ago, so I think I'm a begginer. 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] store files to datastore in a folder like structure?
I am porting my WebOS(Shedokan OS) to python from php so I can use it og GAE and I came to the stage where I need to read and write files. And after a lot of searching I found out that I cannot create files or write to files. here is my code: from google.appengine.ext import db class File(db.Model): filename = db.StringProperty(multiline=False) filedata = db.BlobProperty date = db.DateTimeProperty(auto_now_add=True) def createFile(fileName, content): if fileName=='' or content=='': return file = File() file.filedata = content file.filename = fileName file.put() def getFile(fileName): if fileName=='': return return db.GqlQuery('SELECT * FROM File WHERE filename= :1',fileName) any way to make this work with a folder structure? also I want to note that I started learning python just about 3 days ago, so I think I'm a begginer. 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] 411 length required on POST error - Content-length header specified
I have my app here: http://shedokan-os.appspot.com/ at the start of the app it sends a post request to the server. and instead of giving the content it supposed to it gives out the error POST requests require a Content-length header. and I did specify that kind of header. what's wrong? --~--~-~--~~~---~--~~ 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] You have sent too many SMS verification messages?
I get this message every time I'm trying sending a message to my cellphone. at first I sent a couple of messages and then realized I putted a zero instead of two, so I corrected my number. but it tells me I sent too many messages, will this message expire? or I'll have to ask for your 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---