[google-appengine] Re: Fetch with limit returning more results than limit

2009-07-15 Thread Ian Lewis
Ben,

It looks like filter will add a filter to the existing query object (instead
of creating a new query object like django does) but the fetch method will
retrieve the objects and return them immediately without modifying the
query. You should do something like:

items_list = items.fetch(10)

and then pass the items_list to your template.

Ian

On Wed, Jul 15, 2009 at 9:02 AM, Ben bhym...@gmail.com wrote:


 Hi, i am trying to limit the number of results returned on a query to
 10, but i seem to be getting all results back instead of just 10.  Am
 i missing something with the fetch syntax?

 -code-
items = Item.all()
items.filter('adminOnly = ', False)
items.filter('status = ', 2)
items.order('-wins')
items.fetch(limit=10)


template_values = {
  'userInfo': userInfo,
  'appDetails': appConfig.details,
  'items': items,
  'links': links,
  }

 -/code

 when i iterate through the results via django in the template it
 appears the query is properly applying the filters, and the order, but
 is returning all results that meet that criteria instead of just the
 first 10.
 



-- 
===
株式会社ビープラウド  イアン・ルイス
〒150-0012
東京都渋谷区広尾1-11-2アイオス広尾ビル604
email: ianmle...@beproud.jp
TEL:03-5795-2707
FAX:03-5795-2708
http://www.beproud.jp/
===

--~--~-~--~~~---~--~~
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] Using the task queue for sending emails

2009-07-15 Thread Jonathan

The canonical example given for using the task queue is to send
emails. How does this work with the restrictions around only being
able to send emails on behalf of a logged in user?

I am starting to butt up against these email restrictions. I want to
be able to send automated emails occasionally on behalf of one user to
another user. I don't want the user to be logged in for this to
happen, and I don't want the email to come from the application. It
would also be nice to be able to use the task queue for these emails.
I don't think this is possible.

I can kind of understand the thinking behind putting these restictions
in: (to stop spamming perhaps?). But it actually doesn't stop that at
all. It just stops googles email servers being used for that. The
users emails are directly harvestable, and able to be used somewhere
else if that is the desire of the application owner.

I propose allowing applications to send to send emails on a user's
behalf when they are not logged in. Maybe, we could get them to click
a give permission for this application to send emails on your behalf
box if you think it is still a problem...

To this end I have created this feature request:
http://code.google.com/p/googleappengine/issues/detail?id=1869
--~--~-~--~~~---~--~~
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: Problems with SMS, and replying to messages in group

2009-07-15 Thread Nick Johnson (Google)

Hi udisanet,

I've activated your account.

-Nick Johnson

On Tue, Jul 14, 2009 at 10:51 PM, udisanetenterprisere...@gmail.com wrote:

 Hi,

 In Chile there is no support for sending sms, is there an alternative
 way to activate my account?

 thank you very much
 Alex


 On Jul 14, 6:27 am, Nick Johnson (Google) nick.john...@google.com
 wrote:
 Hi Aivar,

 I've activated your account.

 -Nick Johnson



 On Sun, Jul 12, 2009 at 6:46 PM, Aivaraivar.anna...@gmail.com wrote:

  Hi!

  I've tried several times to activate my google app engine account
  using numbers on 2 different Estonian carriers (EMT and Tele2) without
  any success. Now i get You have sent too many SMS verification
  messages.

  I tried to report SMS problem, but after submitting the form i only
  got a short error message (Carrier)

  I tried to reply to threads that discussed SMS problems, i got message
  post was successful but i didn't show up in thread (even 1 day
  later).

  I hope this message ends up somewhare and somebody can help me.

  Thanks in advance!!

  Aivar

 --
 Nick Johnson, App Engine Developer Programs Engineer
 Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
 Number: 368047

 




-- 
Nick Johnson, App Engine Developer Programs Engineer
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
Number: 368047

--~--~-~--~~~---~--~~
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: remote_api -ImportError: No module named models

2009-07-15 Thread Nick Johnson (Google)

Hi Vincent,

See the solution you quoted - you need to make sure PYTHONPATH
includes the path to your app.

-Nick Johnson

On Tue, Jul 14, 2009 at 9:48 PM, Vincentvinc...@louviaux.com wrote:

 I have also the trouble but under linux
 no models module found

 ImportError: No module named models

 any idea ?


 On 17 juin, 18:02, johnfromCalgary jdpo...@gmail.com wrote:
 That worked, thanks.
 (I actually saw that answer to another post earlier, and for some
 reason misunderstood the instruction)

 On Jun 17, 4:46 am, Nick Johnson (Google) nick.john...@google.com
 wrote:

  Hi johnfromCalgary,

  Try running set PYTHONPATH=. in your shell window before running the
  import script.

  -Nick Johnson

  On Wed, Jun 17, 2009 at 1:30 AM, johnfromCalgary jdpo...@gmail.com wrote:

   It seems like variations of this question has been asked a few times,
   but I can't get tell which of the answers are out of date, in any
   case, none of the solutions work.

   I've followed this verbatim:http://code.google.com/appengine/docs/
   python/tools/uploadingdata.htmlhttp://code.google.com/appengine/docs/%0Apython/tools/uploadingdata.html

   and get the error: ImportError:Nomodulenamedmodels

   Let many java users, I'm only using this to get data into the data
   store; I've spent more time on this than everything else combined...
   and so my python knowledge is zilch.

   I seems like I need to add the current directory to the python_path or
   something, but I'm not sure how to do that, and it's only a guess.

   I'm on Windows Vista.

   Any guidance would be appreciated.

   Thanks,
   John

  --
  Nick Johnson, App Engine Developer Programs Engineer
  Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
  368047

 




-- 
Nick Johnson, App Engine Developer Programs Engineer
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
Number: 368047

--~--~-~--~~~---~--~~
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: Your application is exceeding a quota

2009-07-15 Thread Nick Johnson (Google)

Hi Richard,

You're running into short term quotas, which are designed to prevent
you exhausting your entire quota for the day in one go. You need to
rate-limit your bulk loading code, and/or pay for additional quota.
Even enabling billing without setting a high limit will increase your
short term quotas automatically.

You should also look at your bulk loading code and make sure it's as
efficient as possible. One possibility is to use the Python
bulkloader.

As far as deletion goes, make sure you are doing key-only queries to
get the key to delete, which will save on CPU time and timeouts.

-Nick Johnson

On Wed, Jul 15, 2009 at 12:11 AM, richard
embersonrichard.ember...@gmail.com wrote:


 So, once again, I've tried to upload some data.

 After a couple, I guess, thousand records I start
 getting HttpServletResponse.SC_FORBIDDEN from
 the app engine server.

 On the Dashboard it says:

 Your application is exceeding a quota: CPU Time
 Your application is exceeding a quota: Datastore CPU Time

 but under Resource, CPU Time usage is at 34%
 and Stored Data usage is at 4%.

 I am trying to develop an application on GAE.
 I will need to load tens of thousands or
 a couple of hundred thousand entities as part
 of testing the application. I will then want
 to delete those entities.

 Currently, I can only load a couple of hundred
 before the app engine starts rejecting additional
 uploads. And I can not delete any of them - I
 keep getting timeouts - even if I try to delete only
 10.

 Is there some upload per minute quota or something?
 And, whats the magic to delete stuff.

 The following code causes timeouts:

     DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
     final Query q = new Query(kindName);
     q.setKeysOnly();

     final IterableEntity entities = ds.prepare(q).asIterable(
                 FetchOptions.Builder.withLimit(count));
     KeyIterable ki = new KeyIterable(entities);
     ds.delete(ki);
     int numberDeleted = ki.getCount();
     return numberDeleted;



 Richard

 --
 Quis custodiet ipsos custodes

 




-- 
Nick Johnson, App Engine Developer Programs Engineer
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
Number: 368047

--~--~-~--~~~---~--~~
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: Create additional applications

2009-07-15 Thread Nick Johnson (Google)

Hi phtq,

What account are you signing in with? Is it the one you're using to
post to this group?

-Nick Johnson

On Tue, Jul 14, 2009 at 10:45 PM, phtqpher...@typequick.com.au wrote:

 Hello Nick,

 No change. I did get an email with the subject Welcome to an early
 look at Google App Engine for Java!, but when I try to create a new
 application I still land on the SMS verification page.


 On Jul 14, 7:43 pm, Nick Johnson (Google) nick.john...@google.com
 wrote:
 Hi phtq,

 I've manually activated your account. Let me know if that helps.

 -Nick Johnson

 On Tue, Jul 14, 2009 at 1:43 AM, phtqpher...@typequick.com.au wrote:

  Hi, I need to add an application to my googleappengine account, but
  when I press the Create an Application button I get taken to the
  Verify your account by SMS page where I get stuck as I have already
  used the mobile number for SMS verification.

  Can this be bypassed or do I need to dig out another phone?

 --
 Nick Johnson, App Engine Developer Programs Engineer
 Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
 Number: 368047
 




-- 
Nick Johnson, App Engine Developer Programs Engineer
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
Number: 368047

--~--~-~--~~~---~--~~
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: Application Updates but Does Not Serve New Files?

2009-07-15 Thread Nick Johnson (Google)

Hi Devel63,

We need to know what files you're serving that appear to be old, and
what they should be serving. My money is on a client-side caching
issue, but it's impossible to tell without more details.

-Nick Johnson

On Tue, Jul 14, 2009 at 11:29 PM, Devel63danstic...@gmail.com wrote:

 Today I am suddenly unable to effectively update my app.

 appcfg.py appears to update the app, the serving version is set
 correctly, but the old files are being served.

 The app name is judysapps-qa

 Any ideas?
 




-- 
Nick Johnson, App Engine Developer Programs Engineer
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
Number: 368047

--~--~-~--~~~---~--~~
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: remote_api -ImportError: No module named models

2009-07-15 Thread Vincent

ok it s working

Thanks

Vincent

export PYTHONPATH=~/google_appengine/myapp


On 15 juil, 10:18, Nick Johnson (Google) nick.john...@google.com
wrote:
 Hi Vincent,

 See the solution you quoted - you need to make sure PYTHONPATH
 includes the path to your app.

 -Nick Johnson



 On Tue, Jul 14, 2009 at 9:48 PM, Vincentvinc...@louviaux.com wrote:

  I have also the trouble but under linux
  no models module found

  ImportError: No module named models

  any idea ?

  On 17 juin, 18:02, johnfromCalgary jdpo...@gmail.com wrote:
  That worked, thanks.
  (I actually saw that answer to another post earlier, and for some
  reason misunderstood the instruction)

  On Jun 17, 4:46 am, Nick Johnson (Google) nick.john...@google.com
  wrote:

   Hi johnfromCalgary,

   Try running set PYTHONPATH=. in your shell window before running the
   import script.

   -Nick Johnson

   On Wed, Jun 17, 2009 at 1:30 AM, johnfromCalgary jdpo...@gmail.com 
   wrote:

It seems like variations of this question has been asked a few times,
but I can't get tell which of the answers are out of date, in any
case, none of the solutions work.

I've followed this verbatim:http://code.google.com/appengine/docs/
python/tools/uploadingdata.htmlhttp://code.google.com/appengine/docs/%0Apython/tools/uploadingdata.html

and get the error: ImportError:Nomodulenamedmodels

Let many java users, I'm only using this to get data into the data
store; I've spent more time on this than everything else combined...
and so my python knowledge is zilch.

I seems like I need to add the current directory to the python_path or
something, but I'm not sure how to do that, and it's only a guess.

I'm on Windows Vista.

Any guidance would be appreciated.

Thanks,
John

   --
   Nick Johnson, App Engine Developer Programs Engineer
   Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration 
   Number:
   368047

 --
 Nick Johnson, App Engine Developer Programs Engineer
 Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
 Number: 368047
--~--~-~--~~~---~--~~
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] Need input: developers and Azure VS GAE

2009-07-15 Thread mytemp

Hi,

What's the best mechanism (or resource) to find rockstar
GoogleAppEngine/Python developers working on contract for an hourly
rate?

Also, has anyone done a good analysis of Azure vs GAE?  I've already
eliminated AWS as I don't want to manage VM instances/management/
scaling nor OS images/software.

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] Datastore Utility

2009-07-15 Thread JoeM

Hi All,

Does anyone know of a datastore utility that can do the following
things:

1)  Run on a developers machine accessing the local datastore.
2)  Test the integrity of a .datastore file.
3)  Present the schema of the .datastore file.
4)  Allow interactive queries from a command line or GUI interface.

Thanks, Joe
--~--~-~--~~~---~--~~
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] Calculate CPU hours

2009-07-15 Thread Rodion

Hi,

i want to calculate the cpu hours my application uses. the basic
functionality of the application is the following: it receives
messages and has to store the content :) i haven't implemented the
application yet, so I can not test how much cpu is needed..
the size of the received data is approximately 28 KB per second (1.6
MB per minute). How do I compute / estimate the cpu hours when the
application runs 24/7 ?

cheers
--~--~-~--~~~---~--~~
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: uploadingdata with a no gmail account

2009-07-15 Thread Nick Johnson (Google)

Hi Vincent,

In situations like this, you need to create a gmail account, and add
it as an administrator of your app. Then, use its credentials to do
bulk up/down- loading.

-Nick Johnson

On Wed, Jul 15, 2009 at 9:48 AM, Vincentvinc...@louviaux.com wrote:

 Hi

 I am still trying to download data from my app following this tutorial
 http://code.google.com/intl/fr/appengine/docs/python/tools/uploadingdata.html


 But the auth always failed, I thinks it s because my Google account
 has no gmail account.

 Also to see my application console I need to go on 
 http://appengine.google.com/a/DOMAIN.COM
 I can log in on http://appengine.google.com/ with
 vinc...@louviaux.com but I see no apps ..
 I have also try to add others developers with a gmail adress but there
 are automatically removed when they accept ..
 I used the is_current_user_admin() function in my app and I am never
 detected as admin ..


 So how can I be correctly auth ?


 appcfg.py download_data --config_file=gac/Article_loader.py --
 filename=/tmp/article_data_archive.csv --kind=Article -e
 vinc...@louviaux.com gac

 Downloading data records.
 [INFO    ] Logging to bulkloader-log-20090715.103621
 [INFO    ] Opening database: bulkloader-progress-20090715.103621.sql3
 [INFO    ] Opening database: bulkloader-results-20090715.103621.sql3
 [INFO    ] Connecting to /remote_api
 Password for vinc...@louviaux.com:
 [INFO    ] Authentication Failed

 




-- 
Nick Johnson, App Engine Developer Programs Engineer
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
Number: 368047

--~--~-~--~~~---~--~~
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: Optimal tree structure with datastore

2009-07-15 Thread Nick Johnson (Google)

On Tue, Jul 14, 2009 at 8:35 PM, Peter Cicmanpcic...@gmail.com wrote:

 Hi Nick,

 no, level and position are not identical.

 The idea behind it is to use level for node to know how deep in tree
 it exists, so root nodes have level=0, node with one parent have
 level=1, node with three parents (A-B-C-D) have level=3, etc.. This
 should allow simple move in path.. WHERE level ...

 Position will be used just for sorting. It will start in every subtree
 with zero value, and will be incremented when new node is added, so it
 will be possible to reorder node position in subtree, something like
 this should be possible:

Ah. The distinction wasn't clear initially. Given that 'position' in
your example appears to apply to all nodes of a given depth, how will
you efficiently calculate and update this? Inserting a new leftmost
leaf node would require renumbering every other node's position.


 BEFORE:
        A(0)            level = 0
    /    |    \
  B(0)   C(1)   D(2)     level = 1
       /   \
    E(0)   F(1)         level = 2


 (Note: number in brackets represents position)

 AFTER (node B, C reorder):

        A(0)            level = 0
    /    |    \
  C(0)  B(1)  D(2)      level = 1
  /   \
 E(0)  F(1)              level = 2


 What do you think about it? There will be probably maximum few
 hundreds of levels. Does it fits for datastore?

Yes, though a 'few hundred' is getting to the point where the
ListProperty of ancestors will take a significant amount of time to
update.


 Do i have to create index on parents property? If yes, size of this
 index will probably grow nonlinear with growing amount of levels. And
 i have to put also position, level and yet another two or three
 properties under index. What is the maximum index size? I did found
 just one information about it in documentation - `its huge`, but what
 does huge exactly mean?

You only have to index the properties if you want to execute queries
against them that use more than one property and involve an inequality
or a sort order. See the indexing documentation for more details. The
indexing is limited by index entries per entity, not size - and the
limit is in the low thousands.



 My hopefully last question :)

 Is there somewhere some paper about deeper explanation of datastore?
 It would be nice to know how it exactly works in deeper level, how are
 the query counters working (i had some problem there also), etc...

Reading the Bigtable paper would be a good start.

-Nick Johnson


 Thanks a lot!
 Peter.

 On Jul 14, 11:47 am, Nick Johnson (Google) nick.john...@google.com
 wrote:
 Hi Peter,





 On Mon, Jul 13, 2009 at 6:56 PM, Peter Cicmanpcic...@gmail.com wrote:

  Hi Nick, hi Vince, i did come up with something like this yesterday:

  class Tree(db.Expando):
     parents = ListProperty()
     level = IntegerProperty()
     position = IntegerProperty()

  properties:
     parents: sorted list of all parent keys, sorting order top/down,
  so parents[-1] gives object direct parent
     level: nested level, for root nodes = 0, for children of root node
  = 1, etc..
     position: node position in current subtree, 0 on top, n on bottom

 Won't level and position always be identical?



  Probably it will work, parent, children, descendants selection should
  be possible. Its probably very close to solution described by Nick.

  

  But anyway, the key paths looks like so nice solution for tree
  structure, so i'm still thinking about them. It brings up some
  questions:

 Key names internally use the same sort of structure as you just
 outlined using a ListProperty. Given that you want to move your
 objects without renaming them, using parent relationships is not a
 good idea here.



     - is there a possibility to use other property for path than a
  key? probably not if i understand the implementation

 No, only the key works.



     - moving the node with all descendants is currently be possible
  this way: copy node, change key, save it, delete original node. the
  question is - if the datastore is represented like a hash, why key
  change isn't allowed? What is so difficult on this?

 You also need to repeat the operation for all child entities of the object.

 The datastore is not stored as a hash table, it's stored as a sorted
 list. Key changes aren't permitted because they're identical to a
 deletion followed by an insertion - so we expose that fact to the
 user.

 -Nick Johnson







     - if the key change really isn't possible on datastore level,
  can't there be some helper in datastore API for doing this (change
  instance key / change instance keys on node + all descendants,
  eventually also delete method, which performs descendants deletion
  when parent gets removed)..

  Thanks...

  On Jul 13, 1:51 pm, Vince Stross vstr...@gmail.com wrote:
  I use the following structure:

  class Tag (db.Expando):
    label = StringProperty()
    parent_ = SelfReferenceProperty(collection_name='children')

  This is a 

[google-appengine] Re: Webservice authentication (Python)

2009-07-15 Thread Nick Johnson (Google)

On Tue, Jul 14, 2009 at 8:03 PM, epbesbenbu...@gmail.com wrote:

 Hi,

 I am trying to make my Python program talk to a web service hosted on
 app engine. I am using the appengine-rest-server and authentication
 using a Google account is required on the server. The idea is that the
 user specifies his username/password in the client application, and
 then the client app. will talk to app engine server via webservices.

You may want to look at appengine_rpc.py, in the SDK
google.appengine.tools package. It is designed specifically for this.


 I found this post:
 http://groups.google.com/group/google-appengine/browse_thread/thread/3bd69f0aa72d4bcb/8f872170bd996ad6?lnk=gstq=webservice+authentication#8f872170bd996ad6.
 The guy who replied proposes the use of Authentication for Installed
 Apps, but also mentions that the GAE service should be ah, which it
 is not according to 
 http://code.google.com/apis/base/faq_gdata.html#clientlogin
 (in fact, GAE is not even listed there). What is the service name for
 GAE (if it exists) and can I access the GAE application in this way?

The service is, as mentioned, 'ah', and yes, you can authenticate
using this method.

 Given the service name I should be able to talk to the server like
 this:

 import urllib, urllib2

 # user-data
 data = urllib.urlencode({'accountType' : 'GOOGLE', 'Email' :
 'x...@gmail.com', 'Passwd': 'xxx', 'service': 'someservice' ,
 'source' : 'Me-MyApp-1.0'})

 # do the log-in
 f = urllib.urlopen('https://www.google.com/accounts/ClientLogin',data)

 # read ClientLogin token (ugly)
 line = f.readline()
 token = ''
 while line:
    if line.startswith('Auth'):
        token = line[5:]
    line = g.readline()

The returned body is urlencoded, so you can use the built in
functionality for this.


 # if we got token, login was completed
 if token:
    # URL to a Model called testmodel (via appengine-rest-server)
    url = 'http://myappengineapp.appspot.com/rest/testmodel'
    # add Authorization header with token
    headers = {'Authorization': 'GoogleLogin auth='+token}
    handler = urllib2.HTTPHandler()
    opener = urllib2.build_opener(handler)
    req = urllib2.Request(url, headers=headers)
    f = opener.open(req)

App Engine apps do not accept authorization headers - instead, you
need to make a request to a special URL with the token to get a user
cookie back. See appengine_rpc.py for details.

-Nick Johnson


    # Do something with response

    # close files
    f.close()
 g.close()

 Correct? In fact, I am able to login, but somehow I can't use the
 token to access the GAE app..

 




-- 
Nick Johnson, App Engine Developer Programs Engineer
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
Number: 368047

--~--~-~--~~~---~--~~
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: Problem with Verify Your Account by SMS

2009-07-15 Thread Nick Johnson (Google)

Hi Thiago,

I've activated your account.

-Nick Johnson

On Tue, Jul 14, 2009 at 3:15 PM, Thiagoth.carne...@gmail.com wrote:

 Hi,
 I am also having problems with SMS account verification. I keep
 getting Mobile Number or Username error.
 I'm from Sydney, Australia. I type +61 and mobile number (no area code
 needed).

 Can I get some advice? Thanks very much!

 Regards,
 Thiago.

 On Jul 9, 7:28 pm, Nick Johnson (Google) nick.john...@google.com
 wrote:
 Hi Luis,

 We store verification details independently of any created apps, so
 that's unlikely to be the problem. Is the account you're using a
 Google Apps one (eg, not @gmail.com)? If so, you need to log in 
 athttp://appengine.google.com/a/yourdomain, not 
 justhttp://appengine.google.com.

 In any case, I've activated the gmail account you're using.

 -Nick Johnson



 On Wed, Jul 8, 2009 at 11:44 PM, Luislme...@gmail.com wrote:

  I think I know exactly what happened. Hopefully this will help Google
  fix the issue.

  About a week ago I did use my phone for account verification for App
  Engine. I did get the code and I typed it in. Then I was presented
  with a form to create my 1st app, but I navigated away as I really
  didn't want to create one at that particular time. I thought I was
  verified so I could come back and create apps at any time. A week
  later I came back and the system wants to verify again but it doesn't
  like my phone number anymore.

  My theory is that because I verified already my phone number doesn't
  work, but because I have no apps the system wants to verify again.

  On Jul 7, 6:32 pm, Luis lme...@gmail.com wrote:
  I get same error but I'm in the US using ATT.

  Any help will be greatly appreciated.
  Thanks,
  - Luis

  On Jul 6, 3:22 am, Nick Johnson (Google) nick.john...@google.com
  wrote:

   Hi vico.ar,

   I've manually activated your account.

   -Nick Johnson

   On Fri, Jul 3, 2009 at 6:31 PM, vico.arvico...@gmail.com wrote:

I have a problem with Verify Your Account bySMS page.

Does anyone know how to verify one's account if you are living in
Argentina?

I entered my number in the format required by the verificator but it
always gives Mobile Number or Username error.

Regards,
Víctor

   --
   Nick Johnson, App Engine Developer Programs Engineer
   Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
   Number: 368047

 --
 Nick Johnson, App Engine Developer Programs Engineer
 Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
 Number: 368047

 




-- 
Nick Johnson, App Engine Developer Programs Engineer
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
Number: 368047

--~--~-~--~~~---~--~~
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 preimium account SMS verification problem

2009-07-15 Thread Nick Johnson (Google)

Hi Joseph,

I've activated your account.

-Nick Johnson

On Tue, Jul 14, 2009 at 1:18 PM, Joseph Lamj...@josephlam.net wrote:

 I'm getting this error The phone number has been sent too many
 messages or has already been used to confirm an account

 I've used my phone number for another free Google account but now I
 want to use it for my Google Apps premium account I just paid for. Can
 someone from Google help me fix this?

 




-- 
Nick Johnson, App Engine Developer Programs Engineer
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
Number: 368047

--~--~-~--~~~---~--~~
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 setup my data layout

2009-07-15 Thread Nick Johnson (Google)

On Tue, Jul 14, 2009 at 5:03 AM, Mark Jonesmark0...@gmail.com wrote:

 I know I'm going to have LOTS of small data records from LOTS of
 people.  I want to get this right so I don't have to fix it later.
 Basically, my plan was to have it structured like this:

 Account/Year/Month/Day/Item

 What I haven't quite figured out is how to get the indices and
 database to cluster around those items.  I know I will want to query a
 list of all items by year, by year and month, and possibly by day
 within an account.   Most day's will consist of 5-20 items per
 account, so I guess it would be possible to  blend day and item
 together. without whole lot of grief since that would still only leave
 me with 600 or so items per Month.

If you don't need your inequality query for something else (eg,
sorting or filtering items within a given time period), you can simply
use a DateProperty and filter based on that (Eg,
MyModel.all().filter('date ', somedate).filter('date ',
someotherdate).all()).

If you do need the inequality, you can create separate year/month/day
IntegerProperties, and do equality filters on each. You will need
indexes for each combination (year/month, year/month/day, etc).


 This is sort of hierarchical and I was planning on using the parent
 key for zoom out and the individual key for zoom in.  What is the best
 way to lay this out?

Unless you need to be able to update multiple items transactionally,
don't do this. All entities with the same root parent are in a single
entity group, and updates to an entity group are serialized, which
limits the rate at which you can update them.

-Nick Johnson


 There is one other thing that may/may not be an issue and that is the
 grouping of Accounts as well, so that some individuals could have
 multiple accounts.  Again though, wanting to cluster all of this
 around the date layout above.

 Thanks for any pointers.

 PS I tried creating classes for Account/Year/Month/Day/Item and then
 creating them with parent relationships.  This seems to mean that I
 have to create and save Account() then Year(), then Month() then Day()
 before I can create Item.  That doesn't seem efficient to me though.

 




-- 
Nick Johnson, App Engine Developer Programs Engineer
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
Number: 368047

--~--~-~--~~~---~--~~
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: SMS activation from Uruguay

2009-07-15 Thread Nick Johnson (Google)

Hi Ricardo,

I've activated your account.

-Nick Johnson

On Tue, Jul 14, 2009 at 6:59 PM, ricardozrzua...@gmail.com wrote:

 Nick, hi. I did just that entering +59899xx (with the x as the
 actual numbers of course) but I get then Mobile Number or Username
 error. The number is correct and the country code too...

 thanks again,
 ricardo

 On 14 jul, 07:05, Nick Johnson (Google) nick.john...@google.com
 wrote:
 Hi ricardoz,

 You need to select 'other (non us)' from the carrier pulldown, then
 enter your full international phone number in the box.

 -Nick Johnson

 On Mon, Jul 13, 2009 at 9:54 PM, ricardozrzua...@gmail.com wrote:

  Hi, I'm trying to create my first Google appengine application but I
  can't get past the SMS activation screen. I live in Uruguay and from
  what I see none of the local communications providers are listed. Is
  there any way I can use app engine from Uruguay?

  Thanks,
  Ricardo

 --
 Nick Johnson, App Engine Developer Programs Engineer
 Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
 Number: 368047
 




-- 
Nick Johnson, App Engine Developer Programs Engineer
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
Number: 368047

--~--~-~--~~~---~--~~
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: sendmail InvalidSenderError

2009-07-15 Thread Wooble



On Jul 14, 8:17 pm, thebrianschott schott.br...@gmail.com wrote:
 Regarding #1:
 I am storing it in the datastore because I want the logged-in user
 user to be able to opt for a different email address -- only one, not
 more. So isn't it Ok to use the datastore for that.

It's impossible for the application to send a message from an address
other than the one actually associated with the account the user used
to login.  If you don't get the address from the User object at the
same time you're sending the message, it will always throw an
exception if the address in the datastore doesn't match that address
(with the added negative side effect that the datastore fetch is going
to be slower than getting the only address that will work directly
from the User object).

 Regarding #2:
 Aren't I doing exactly that, but in two steps in my code snippet?
 step 1: user = users.get_current_user()
 step 2: address = user.email()
 (This may be a stupid assertion, but I am a python novice.)

Yes, you're getting the correct address at the time you write it to
the datastore, but it's not clear that you're using the correct
address at send-time.
--~--~-~--~~~---~--~~
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: Need input: developers and Azure VS GAE

2009-07-15 Thread Adam

I'd say that your best bet for finding developers who are able to work
on AppEngine applications is by posting a message right here in this
group as well as in the google-appengine-python group. I do AppEngine
consulting, and a couple of clients have found me here already. I'm
sure that I'm not the only one.
--~--~-~--~~~---~--~~
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: uploadingdata with a no gmail account

2009-07-15 Thread Vincent

I have a gmail account vlouviaux who is not linked with my google
acount vinc...@domain
I add it as developer , I received well the email in the box
vlouvi...@gmail.com

Then when I log in with my gmail account in appengine, I don't see the
application

And when I log with my @DOMAIN account the developer is removed from
list (pending before)

So how can I have a gmail account for this app ?


On 15 juil, 14:52, Nick Johnson (Google) nick.john...@google.com
wrote:
 Hi Vincent,

 In situations like this, you need to create a gmail account, and add
 it as an administrator of your app. Then, use its credentials to do
 bulk up/down- loading.

 -Nick Johnson



 On Wed, Jul 15, 2009 at 9:48 AM, Vincentvinc...@louviaux.com wrote:

  Hi

  I am still trying to download data from my app following this tutorial
 http://code.google.com/intl/fr/appengine/docs/python/tools/uploadingd...

  But the auth always failed, I thinks it s because my Google account
  has no gmail account.

  Also to see my application console I need to go 
  onhttp://appengine.google.com/a/DOMAIN.COM
  I can log in onhttp://appengine.google.com/with
  vinc...@louviaux.com but I see no apps ..
  I have also try to add others developers with a gmail adress but there
  are automatically removed when they accept ..
  I used the is_current_user_admin() function in my app and I am never
  detected as admin ..

  So how can I be correctly auth ?

  appcfg.py download_data --config_file=gac/Article_loader.py --
  filename=/tmp/article_data_archive.csv --kind=Article -e
  vinc...@louviaux.com gac

  Downloading data records.
  [INFO    ] Logging to bulkloader-log-20090715.103621
  [INFO    ] Opening database: bulkloader-progress-20090715.103621.sql3
  [INFO    ] Opening database: bulkloader-results-20090715.103621.sql3
  [INFO    ] Connecting to /remote_api
  Password for vinc...@louviaux.com:
  [INFO    ] Authentication Failed

 --
 Nick Johnson, App Engine Developer Programs Engineer
 Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
 Number: 368047
--~--~-~--~~~---~--~~
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: Need input: developers and Azure VS GAE

2009-07-15 Thread Adam

And the second part of your question: Azure vs. GAE. I'm not aware of
any formal white papers that exist on this subject; although, I'll
wager cash money that Microsoft has a couple in the pipeline
somewhere. I work with both. I earn my salary being a happy trilobite
in the Microsoft ecosystem, so I have the C# and ASP.NET skills to
take good advantage of Azure. I'm also a hopeless Google fanatic, and
I got on-board with GAE on day one.

My analysis: Azure and AppEngine are more like each other than any of
the other cloud computing platforms, such as Amazon's EC2. They both
give you a new programming model -- a sandbox -- to work in that
encourages you to architect your applications in a way that allows
them to take advantage of the instant, no-effort, on-demand scaling
that is the real, compelling advantage of the Cloud.

They both give applications fairly generous free quotas that give the
developer and extremely-low cost-of-entry, enabling him of her to
build and deploy an application without up-front and.or monthly cash
outlays. If you are lucky/smart your application can be generating
enough revenue to more than cover its costs before you have to start
paying for resources.

The main decision point between the two platforms comes down to the
technology that you want to use to build your web application. Do you
have access to C# and ASP.NET skills? Azure is a good choice. Do you
have a Python/Java open source guru handy? AppEngine is a winner.

A secondary decision point might be your choice of development
platform. The Azure SDK will install and run on Vista or Windows
Server 2008, and you will need a Visual Studio 2008 license. On the
other hand, you can build AppEngine applications on Windows (XP,
Vista, 7, etc), MacOS or Linux.
--~--~-~--~~~---~--~~
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: uploadingdata with a no gmail account

2009-07-15 Thread Nick Johnson (Google)

Did you make sure to log out of App Engine before accepting the invite
in your gmail account? You need to make sure you log in using the
gmail account to accept the invite.

-Nick Johnson

On Wed, Jul 15, 2009 at 3:00 PM, Vincentvinc...@louviaux.com wrote:

 I have a gmail account vlouviaux who is not linked with my google
 acount vinc...@domain
 I add it as developer , I received well the email in the box
 vlouvi...@gmail.com

 Then when I log in with my gmail account in appengine, I don't see the
 application

 And when I log with my @DOMAIN account the developer is removed from
 list (pending before)

 So how can I have a gmail account for this app ?


 On 15 juil, 14:52, Nick Johnson (Google) nick.john...@google.com
 wrote:
 Hi Vincent,

 In situations like this, you need to create a gmail account, and add
 it as an administrator of your app. Then, use its credentials to do
 bulk up/down- loading.

 -Nick Johnson



 On Wed, Jul 15, 2009 at 9:48 AM, Vincentvinc...@louviaux.com wrote:

  Hi

  I am still trying to download data from my app following this tutorial
 http://code.google.com/intl/fr/appengine/docs/python/tools/uploadingd...

  But the auth always failed, I thinks it s because my Google account
  has no gmail account.

  Also to see my application console I need to go 
  onhttp://appengine.google.com/a/DOMAIN.COM
  I can log in onhttp://appengine.google.com/with
  vinc...@louviaux.com but I see no apps ..
  I have also try to add others developers with a gmail adress but there
  are automatically removed when they accept ..
  I used the is_current_user_admin() function in my app and I am never
  detected as admin ..

  So how can I be correctly auth ?

  appcfg.py download_data --config_file=gac/Article_loader.py --
  filename=/tmp/article_data_archive.csv --kind=Article -e
  vinc...@louviaux.com gac

  Downloading data records.
  [INFO    ] Logging to bulkloader-log-20090715.103621
  [INFO    ] Opening database: bulkloader-progress-20090715.103621.sql3
  [INFO    ] Opening database: bulkloader-results-20090715.103621.sql3
  [INFO    ] Connecting to /remote_api
  Password for vinc...@louviaux.com:
  [INFO    ] Authentication Failed

 --
 Nick Johnson, App Engine Developer Programs Engineer
 Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
 Number: 368047
 




-- 
Nick Johnson, App Engine Developer Programs Engineer
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
Number: 368047

--~--~-~--~~~---~--~~
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: Need input: developers and Azure VS GAE

2009-07-15 Thread Andrew Badera
Actually Azure team announced commercial availability and pricing yesterday.
I don't believe production software, or any storage, will have a free quota
any longer:

http://blogs.msdn.com/windowsazure/archive/2009/07/14/confirming-commercial-availability-and-announcing-business-model.aspx#

Thanks-
- Andy Badera
- and...@badera.us
- Google me: http://www.google.com/search?q=andrew+badera
- This email is: [ ] bloggable [x] ask first [ ] private


On Wed, Jul 15, 2009 at 10:05 AM, Adam adam.crossl...@gmail.com wrote:


 And the second part of your question: Azure vs. GAE. I'm not aware of
 any formal white papers that exist on this subject; although, I'll
 wager cash money that Microsoft has a couple in the pipeline
 somewhere. I work with both. I earn my salary being a happy trilobite
 in the Microsoft ecosystem, so I have the C# and ASP.NET skills to
 take good advantage of Azure. I'm also a hopeless Google fanatic, and
 I got on-board with GAE on day one.

 My analysis: Azure and AppEngine are more like each other than any of
 the other cloud computing platforms, such as Amazon's EC2. They both
 give you a new programming model -- a sandbox -- to work in that
 encourages you to architect your applications in a way that allows
 them to take advantage of the instant, no-effort, on-demand scaling
 that is the real, compelling advantage of the Cloud.

 They both give applications fairly generous free quotas that give the
 developer and extremely-low cost-of-entry, enabling him of her to
 build and deploy an application without up-front and.or monthly cash
 outlays. If you are lucky/smart your application can be generating
 enough revenue to more than cover its costs before you have to start
 paying for resources.

 The main decision point between the two platforms comes down to the
 technology that you want to use to build your web application. Do you
 have access to C# and ASP.NET skills? Azure is a good choice. Do you
 have a Python/Java open source guru handy? AppEngine is a winner.

 A secondary decision point might be your choice of development
 platform. The Azure SDK will install and run on Vista or Windows
 Server 2008, and you will need a Visual Studio 2008 license. On the
 other hand, you can build AppEngine applications on Windows (XP,
 Vista, 7, etc), MacOS or Linux.
 


--~--~-~--~~~---~--~~
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: SMS activation from Uruguay

2009-07-15 Thread Ricardo Zuasti

Nick, thanks a lot, I'll try it right away.

rgds,
ricardo

On Wed, Jul 15, 2009 at 10:27 AM, Nick Johnson
(Google)nick.john...@google.com wrote:

 Hi Ricardo,

 I've activated your account.

 -Nick Johnson

 On Tue, Jul 14, 2009 at 6:59 PM, ricardozrzua...@gmail.com wrote:

 Nick, hi. I did just that entering +59899xx (with the x as the
 actual numbers of course) but I get then Mobile Number or Username
 error. The number is correct and the country code too...

 thanks again,
 ricardo

 On 14 jul, 07:05, Nick Johnson (Google) nick.john...@google.com
 wrote:
 Hi ricardoz,

 You need to select 'other (non us)' from the carrier pulldown, then
 enter your full international phone number in the box.

 -Nick Johnson

 On Mon, Jul 13, 2009 at 9:54 PM, ricardozrzua...@gmail.com wrote:

  Hi, I'm trying to create my first Google appengine application but I
  can't get past the SMS activation screen. I live in Uruguay and from
  what I see none of the local communications providers are listed. Is
  there any way I can use app engine from Uruguay?

  Thanks,
  Ricardo

 --
 Nick Johnson, App Engine Developer Programs Engineer
 Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
 Number: 368047
 




 --
 Nick Johnson, App Engine Developer Programs Engineer
 Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
 Number: 368047

 




-- 
Ricardo Zuasti

--~--~-~--~~~---~--~~
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] Doing Appengine settings programmatically

2009-07-15 Thread vijay
HI All,I am writing an application in Java which will create a website for
my users using some custom fields. I want that the website built and this
application will be deployed on App Engine. Assuming that My user trust my
application and I can have their username and password enterd to my
applications setting page, how to do all Appengine settings programmatically.
Are their any API available for this.
The reason I want to do it this way is that the user can directly handle
their app engine interaction and can pay for usage over freebie quota.

Thanks
Vijay

--~--~-~--~~~---~--~~
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: Fetch with limit returning more results than limit

2009-07-15 Thread Ben

That worked, thank you Ian!

On Jul 15, 1:24 am, Ian Lewis ianmle...@gmail.com wrote:
 Ben,

 It looks like filter will add a filter to the existing query object (instead
 of creating a new query object like django does) but the fetch method will
 retrieve the objects and return them immediately without modifying the
 query. You should do something like:

 items_list = items.fetch(10)

 and then pass the items_list to your template.

 Ian



 On Wed, Jul 15, 2009 at 9:02 AM, Ben bhym...@gmail.com wrote:

  Hi, i am trying to limit the number of results returned on a query to
  10, but i seem to be getting all results back instead of just 10.  Am
  i missing something with the fetch syntax?

  -code-
 items = Item.all()
 items.filter('adminOnly = ', False)
 items.filter('status = ', 2)
 items.order('-wins')
 items.fetch(limit=10)

 template_values = {
   'userInfo': userInfo,
   'appDetails': appConfig.details,
   'items': items,
   'links': links,
   }

  -/code

  when i iterate through the results via django in the template it
  appears the query is properly applying the filters, and the order, but
  is returning all results that meet that criteria instead of just the
  first 10.

 --
 ===
 株式会社ビープラウド  イアン・ルイス
 〒150-0012
 東京都渋谷区広尾1-11-2アイオス広尾ビル604
 email: ianmle...@beproud.jp
 TEL:03-5795-2707
 FAX:03-5795-2708http://www.beproud.jp/
 ===
--~--~-~--~~~---~--~~
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: Webservice authentication (Python)

2009-07-15 Thread Tony

Since I happened to have this up, here's a bit of sample code to get
an authentication cookie for an appspot app...

from google.appengine.api import urlfetch
from urllib import urlencode
email = request.POST['username']
passwd = request.POST['password']
serv_root = http://myapp.appspot.com;
target = 'http://myapp.appspot.com/null'
app_name = myapp-1.0
auth_uri = 'https://www.google.com/accounts/ClientLogin'
authreq_data = urlencode({ Email:   email,
  Passwd:  passwd,
  service: ah,
  source:  app_name,
  accountType: HOSTED_OR_GOOGLE })
result = urlfetch.fetch(auth_uri, authreq_data, method=urlfetch.POST,
follow_redirects=False)
auth_dict = dict(x.split(=) for x in result.content.split(\n) if
x)
auth_token = auth_dict[Auth]
serv_args = {}
serv_args['continue'] = target
serv_args['auth'] = auth_token
serv_uri = %s/_ah/login?%s % (serv_root, urlencode(serv_args))
result2 = urlfetch.fetch(serv_uri, follow_redirects=False,
method=urlfetch.GET)
### here's the cookie which will authenticate future requests
cookie = result2.headers['set-cookie'].split(';')[0]
# cookie[0] = ACSID
# cookie[1] = HFSDJHSDFHSDJFHSDJFHSJFSDfsdjfhsjdfhsjdfh...
--~--~-~--~~~---~--~~
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: uploadingdata with a no gmail account

2009-07-15 Thread Vincent

Thanks a lot !
it s work

Vincent

On 15 juil, 16:05, Nick Johnson (Google) nick.john...@google.com
wrote:
 Did you make sure to log out of App Engine before accepting the invite
 in your gmail account? You need to make sure you log in using the
 gmail account to accept the invite.

 -Nick Johnson



 On Wed, Jul 15, 2009 at 3:00 PM, Vincentvinc...@louviaux.com wrote:

  I have a gmail account vlouviaux who is not linked with my google
  acount vinc...@domain
  I add it as developer , I received well the email in the box
  vlouvi...@gmail.com

  Then when I log in with my gmail account in appengine, I don't see the
  application

  And when I log with my @DOMAIN account the developer is removed from
  list (pending before)

  So how can I have a gmail account for this app ?

  On 15 juil, 14:52, Nick Johnson (Google) nick.john...@google.com
  wrote:
  Hi Vincent,

  In situations like this, you need to create a gmail account, and add
  it as an administrator of your app. Then, use its credentials to do
  bulk up/down- loading.

  -Nick Johnson

  On Wed, Jul 15, 2009 at 9:48 AM, Vincentvinc...@louviaux.com wrote:

   Hi

   I am still trying to download data from my app following this tutorial
  http://code.google.com/intl/fr/appengine/docs/python/tools/uploadingd...

   But the auth always failed, I thinks it s because my Google account
   has no gmail account.

   Also to see my application console I need to go 
   onhttp://appengine.google.com/a/DOMAIN.COM
   I can log in onhttp://appengine.google.com/with
   vinc...@louviaux.com but I see no apps ..
   I have also try to add others developers with a gmail adress but there
   are automatically removed when they accept ..
   I used the is_current_user_admin() function in my app and I am never
   detected as admin ..

   So how can I be correctly auth ?

   appcfg.py download_data --config_file=gac/Article_loader.py --
   filename=/tmp/article_data_archive.csv --kind=Article -e
   vinc...@louviaux.com gac

   Downloading data records.
   [INFO    ] Logging to bulkloader-log-20090715.103621
   [INFO    ] Opening database: bulkloader-progress-20090715.103621.sql3
   [INFO    ] Opening database: bulkloader-results-20090715.103621.sql3
   [INFO    ] Connecting to /remote_api
   Password for vinc...@louviaux.com:
   [INFO    ] Authentication Failed

  --
  Nick Johnson, App Engine Developer Programs Engineer
  Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
  Number: 368047

 --
 Nick Johnson, App Engine Developer Programs Engineer
 Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
 Number: 368047
--~--~-~--~~~---~--~~
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: Need input: developers and Azure VS GAE

2009-07-15 Thread John
I second Adam's idea regarding Azure vs AppEngine. It comes down to C#/
ASP.NET vs Python/Java. What skills/developers do you have access to. If you
have both a good Python and C#/ASP.NETdeveloper, I would probably go
for GAE/Python because of Python's innate
benefits such as being able to have more readable code (good for
business expansion), rapid development, etc.

On Wed, Jul 15, 2009 at 10:05 PM, Adam adam.crossl...@gmail.com wrote:


 And the second part of your question: Azure vs. GAE. I'm not aware of
 any formal white papers that exist on this subject; although, I'll
 wager cash money that Microsoft has a couple in the pipeline
 somewhere. I work with both. I earn my salary being a happy trilobite
 in the Microsoft ecosystem, so I have the C# and ASP.NET skills to
 take good advantage of Azure. I'm also a hopeless Google fanatic, and
 I got on-board with GAE on day one.

 My analysis: Azure and AppEngine are more like each other than any of
 the other cloud computing platforms, such as Amazon's EC2. They both
 give you a new programming model -- a sandbox -- to work in that
 encourages you to architect your applications in a way that allows
 them to take advantage of the instant, no-effort, on-demand scaling
 that is the real, compelling advantage of the Cloud.

 They both give applications fairly generous free quotas that give the
 developer and extremely-low cost-of-entry, enabling him of her to
 build and deploy an application without up-front and.or monthly cash
 outlays. If you are lucky/smart your application can be generating
 enough revenue to more than cover its costs before you have to start
 paying for resources.

 The main decision point between the two platforms comes down to the
 technology that you want to use to build your web application. Do you
 have access to C# and ASP.NET skills? Azure is a good choice. Do you
 have a Python/Java open source guru handy? AppEngine is a winner.

 A secondary decision point might be your choice of development
 platform. The Azure SDK will install and run on Vista or Windows
 Server 2008, and you will need a Visual Studio 2008 license. On the
 other hand, you can build AppEngine applications on Windows (XP,
 Vista, 7, etc), MacOS or Linux.
 



-- 
Cheers,

John
Creative Director / Software Engineer
Digital Eternal (http://www.digitaleternal.com)
Web Design/Development, Business Strategy, Internet Advertising, SEO,
Branding

--~--~-~--~~~---~--~~
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] Eating one's own dog food

2009-07-15 Thread richard emberson

Eating one's own dog food
http://en.wikipedia.org/wiki/Eating_one's_own_dog_food
or in this case:
Using one's own cloud.

Amazon' cloud is based upon the IT technology they use
within Amazon.
Salesforce.com's Force.com offering is what they used to
build their CRM system.

These cloud vendors Eat their own dog food.

If a cloud vendor does not use their cloud offering for
their other products and/or internal systems, one
would have to assume that the cloud is viewed as
a technology ghetto within their own corporation - good
enough for others but not for ourselves.

So, concerning the Google App Engine, are other groups
within Google clamoring to port or build their offerings
on top of the App Engine? If so, please be specific, what
Google products and infrastructure and what are the schedules
for their hosting on GAE?

Is the GAE group supporting the Google Docs group as they
move to use GAE? How about gmail, will the Google Gmail
group be relying on GAE support? I have not seen emails
from either of those internal Google groups on the GAE
mailing list. Lastly, when will Google search be supported
by the GAE group;

Will those groups have to live under the same quota restrictions
while they evaluate using GAE?  If not, why not? If they
are unreasonable for an internal evaluation, what makes them
reasonable for an external evaluation?

Evaluating whether or not GAE should be used for a particular
application is not FREE even if one gets a very small slice
of GAE resources with which to do the evaluation.
Tens or hundreds of hours go into determine if GAE has
the right characteristics and quotas that limit how fast one
can work makes it worse. (Yes one can $$ for higher quotas,
but during the evaluation phase $$ is out of the question.)


Richard Emberson

-- 
Quis custodiet ipsos custodes

--~--~-~--~~~---~--~~
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] Clustering the data and Indices

2009-07-15 Thread Mark Jones

I'm expecting lots of incoming data (about 80-90 million rows per day)
that needs to be broken across many accounts and will largely be
retrieved as a group on the account.

I'm wanting to understand how to set up my entities and entity groups
so that the indexes are clustered around account in such a way that
ingestion and query are both fast.

A total hierarchy looks like:

Account Group -  Queries across a group of accounts where the # of
accounts is small, and queries are few (other than to list the
accounts)

Account - Date bounded queries filtered by one or two fields

What is the correct structure for this kind of datastore.

--~--~-~--~~~---~--~~
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: Eating one's own dog food

2009-07-15 Thread Tony

Though I realize this is not exactly what you're asking, the concept
of GAE is that it exposes some of the infrastructure that all Google
applications rely on (i.e. Datastore) for others to use.  So, in a
sense, Google's various applications were using App Engine before App
Engine existed.  As far as I know, every Google service runs on the
same homogeneous infrastructure, which is part of what makes it so
reliable (and why the only available languages are Python and Java,
languages used internally at Google).

But I don't work there, so maybe I'm completely off-base.

On Jul 15, 12:53 pm, richard emberson richard.ember...@gmail.com
wrote:
 Eating one's own dog 
 foodhttp://en.wikipedia.org/wiki/Eating_one's_own_dog_food
 or in this case:
 Using one's own cloud.

 Amazon' cloud is based upon the IT technology they use
 within Amazon.
 Salesforce.com's Force.com offering is what they used to
 build their CRM system.

 These cloud vendors Eat their own dog food.

 If a cloud vendor does not use their cloud offering for
 their other products and/or internal systems, one
 would have to assume that the cloud is viewed as
 a technology ghetto within their own corporation - good
 enough for others but not for ourselves.

 So, concerning the Google App Engine, are other groups
 within Google clamoring to port or build their offerings
 on top of the App Engine? If so, please be specific, what
 Google products and infrastructure and what are the schedules
 for their hosting on GAE?

 Is the GAE group supporting the Google Docs group as they
 move to use GAE? How about gmail, will the Google Gmail
 group be relying on GAE support? I have not seen emails
 from either of those internal Google groups on the GAE
 mailing list. Lastly, when will Google search be supported
 by the GAE group;

 Will those groups have to live under the same quota restrictions
 while they evaluate using GAE?  If not, why not? If they
 are unreasonable for an internal evaluation, what makes them
 reasonable for an external evaluation?

 Evaluating whether or not GAE should be used for a particular
 application is not FREE even if one gets a very small slice
 of GAE resources with which to do the evaluation.
 Tens or hundreds of hours go into determine if GAE has
 the right characteristics and quotas that limit how fast one
 can work makes it worse. (Yes one can $$ for higher quotas,
 but during the evaluation phase $$ is out of the question.)

 Richard Emberson

 --
 Quis custodiet ipsos custodes
--~--~-~--~~~---~--~~
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: Webservice authentication (Python)

2009-07-15 Thread epb

Thanks for your answers.

As I understand Nick's response, I only need to use appengine_rpc.py
for the entire process. I tried the following:

---

def passwdFunc():
return ('my_email','my_passwd')

rpcServer = appengine_rpc.HttpRpcServer
('myapp.appspot.com',passwdFunc,None,'myAppName')
blah = rpcServer.Send('/')

---

This gave me a 302 error and the following log:

---

Server: myapp.appspot.com
Sending HTTP request:
POST /? HTTP/1.1
Host: myapp.appspot.com
X-appcfg-api-version: 1
Content-type: application/octet-stream


Got http error, this is try #1
Got 302 redirect. Location:
https://www.google.com/accounts/ServiceLogin?service=ahcontinue=http://myapp.appspot.com/_ah/login%3Fconti
nue%3Dhttp://myapp.appspot.com/
ltmpl=gmahname=MyAppNamesig=46378246321321312
Sending HTTP request:
POST /? HTTP/1.1
Host: myapp.appspot.com
X-appcfg-api-version: 1
Content-type: application/octet-stream


Got http error, this is try #2

---

It seems to me that the Send() function should do all authentication-
work automatically and re-direct to the app page after logging in.
Right?

Anyway, I'll try out Tonys solution also..

On Jul 15, 11:18 am, Tony fatd...@gmail.com wrote:
 Since I happened to have this up, here's a bit of sample code to get
 an authentication cookie for an appspot app...

 from google.appengine.api import urlfetch
 from urllib import urlencode
 email = request.POST['username']
 passwd = request.POST['password']
 serv_root = http://myapp.appspot.com;
 target = 'http://myapp.appspot.com/null'
 app_name = myapp-1.0
 auth_uri = 'https://www.google.com/accounts/ClientLogin'
 authreq_data = urlencode({ Email:   email,
                                   Passwd:  passwd,
                                   service: ah,
                                   source:  app_name,
                                   accountType: HOSTED_OR_GOOGLE })
 result = urlfetch.fetch(auth_uri, authreq_data, method=urlfetch.POST,
 follow_redirects=False)
 auth_dict = dict(x.split(=) for x in result.content.split(\n) if
 x)
 auth_token = auth_dict[Auth]
 serv_args = {}
 serv_args['continue'] = target
 serv_args['auth']     = auth_token
 serv_uri = %s/_ah/login?%s % (serv_root, urlencode(serv_args))
 result2 = urlfetch.fetch(serv_uri, follow_redirects=False,
 method=urlfetch.GET)
 ### here's the cookie which will authenticate future requests
 cookie = result2.headers['set-cookie'].split(';')[0]
 # cookie[0] = ACSID
 # cookie[1] = HFSDJHSDFHSDJFHSDJFHSJFSDfsdjfhsjdfhsjdfh...
--~--~-~--~~~---~--~~
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: Eating one's own dog food

2009-07-15 Thread richard emberson

I understand that BigTable is behind GAE, but my concern is
more with GAE performance and quotas. If GAE had existed
when Larry and Sergey were developing their pagerack
algorithm, would they have used GEA for evaluation?
I have my doubts. They would quickly reach quota limits,
way before they knew if they had a viable idea.

Richard

Tony wrote:
 Though I realize this is not exactly what you're asking, the concept
 of GAE is that it exposes some of the infrastructure that all Google
 applications rely on (i.e. Datastore) for others to use.  So, in a
 sense, Google's various applications were using App Engine before App
 Engine existed.  As far as I know, every Google service runs on the
 same homogeneous infrastructure, which is part of what makes it so
 reliable (and why the only available languages are Python and Java,
 languages used internally at Google).
 
 But I don't work there, so maybe I'm completely off-base.
 
 On Jul 15, 12:53 pm, richard emberson richard.ember...@gmail.com
 wrote:
 Eating one's own dog 
 foodhttp://en.wikipedia.org/wiki/Eating_one's_own_dog_food
 or in this case:
 Using one's own cloud.

 Amazon' cloud is based upon the IT technology they use
 within Amazon.
 Salesforce.com's Force.com offering is what they used to
 build their CRM system.

 These cloud vendors Eat their own dog food.

 If a cloud vendor does not use their cloud offering for
 their other products and/or internal systems, one
 would have to assume that the cloud is viewed as
 a technology ghetto within their own corporation - good
 enough for others but not for ourselves.

 So, concerning the Google App Engine, are other groups
 within Google clamoring to port or build their offerings
 on top of the App Engine? If so, please be specific, what
 Google products and infrastructure and what are the schedules
 for their hosting on GAE?

 Is the GAE group supporting the Google Docs group as they
 move to use GAE? How about gmail, will the Google Gmail
 group be relying on GAE support? I have not seen emails
 from either of those internal Google groups on the GAE
 mailing list. Lastly, when will Google search be supported
 by the GAE group;

 Will those groups have to live under the same quota restrictions
 while they evaluate using GAE?  If not, why not? If they
 are unreasonable for an internal evaluation, what makes them
 reasonable for an external evaluation?

 Evaluating whether or not GAE should be used for a particular
 application is not FREE even if one gets a very small slice
 of GAE resources with which to do the evaluation.
 Tens or hundreds of hours go into determine if GAE has
 the right characteristics and quotas that limit how fast one
 can work makes it worse. (Yes one can $$ for higher quotas,
 but during the evaluation phase $$ is out of the question.)

 Richard Emberson

 --
 Quis custodiet ipsos custodes
  
 

-- 
Quis custodiet ipsos custodes

--~--~-~--~~~---~--~~
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: Your application is exceeding a quota

2009-07-15 Thread Nick Johnson (Google)

On Wed, Jul 15, 2009 at 6:14 PM, richard
embersonrichard.ember...@gmail.com wrote:

 Nick,

 Thank you for the response.

 I have tens of thousands of records to load. If I load them
 all at once or rate-limit the load, wont I run out of the
 short term quotas just the same? Or did you mean that I
 ought to rate-limit my load over a number of days or weeks?

The problem you're running into is loading so rapidly you're hitting
the very short term quotas intended to prevent you consuming all your
daily quota at once. If you rate-limit enough, you can avoid hitting
the short-term quotas while still staying within the daily quotas.
Whether or not you need to rate limit enough to cover more than one
day, or buy extra quota, is another issue.


 I am trying to determine if with large datasets, GAE is an
 adequate platform onto which the application I have in mind
 can be hosted. Currently, I am doing an evaluation. I've
 not yet built the application because I want to know if
 GAE has adequate performance.

 I've have already re-written the client-side code that
 extracts the data from the protocol layer and achieved a
 20% performance increase over the shipped 1.2.2 sdk on the
 production GAE server (my new code was only 12% to 15%
 faster on the
 local development server so 20% was unexpected).
 So, performance is critical for me - performance against
 large dataset.

 I don't know if the Python bulkloader will be an improvement.
 I ship the data up as csv blocks with are parsed into Entities
 and then stored. Pretty simple.

The Python bulk loader does all the translation into entities on the
client side, and then uses remote_api to send the encoded data over.
This inevitably leads to less CPU utilization than parsing it yourself
on the server. Nevertheless, the main reason I recommended the Python
bulk loader is because it has support for concurrency and
rate-limiting built right in.


 Concerning the speed of deleting existing data. You suggested
 using key-only queries. In my initial email that you responded
 to, I had a short code snippet where, in deed, I set the
 query to use keys only. So, was the code incorrect?

Sorry, I didn't read the snippet in enough detail.

-Nick Johnson


 Richard Emberson


 Nick Johnson (Google) wrote:
 Hi Richard,

 You're running into short term quotas, which are designed to prevent
 you exhausting your entire quota for the day in one go. You need to
 rate-limit your bulk loading code, and/or pay for additional quota.
 Even enabling billing without setting a high limit will increase your
 short term quotas automatically.

 You should also look at your bulk loading code and make sure it's as
 efficient as possible. One possibility is to use the Python
 bulkloader.

 As far as deletion goes, make sure you are doing key-only queries to
 get the key to delete, which will save on CPU time and timeouts.

 -Nick Johnson

 On Wed, Jul 15, 2009 at 12:11 AM, richard
 embersonrichard.ember...@gmail.com wrote:

 So, once again, I've tried to upload some data.

 After a couple, I guess, thousand records I start
 getting HttpServletResponse.SC_FORBIDDEN from
 the app engine server.

 On the Dashboard it says:

 Your application is exceeding a quota: CPU Time
 Your application is exceeding a quota: Datastore CPU Time

 but under Resource, CPU Time usage is at 34%
 and Stored Data usage is at 4%.

 I am trying to develop an application on GAE.
 I will need to load tens of thousands or
 a couple of hundred thousand entities as part
 of testing the application. I will then want
 to delete those entities.

 Currently, I can only load a couple of hundred
 before the app engine starts rejecting additional
 uploads. And I can not delete any of them - I
 keep getting timeouts - even if I try to delete only
 10.

 Is there some upload per minute quota or something?
 And, whats the magic to delete stuff.

 The following code causes timeouts:

     DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
     final Query q = new Query(kindName);
     q.setKeysOnly();

     final IterableEntity entities = ds.prepare(q).asIterable(
                 FetchOptions.Builder.withLimit(count));
     KeyIterable ki = new KeyIterable(entities);
     ds.delete(ki);
     int numberDeleted = ki.getCount();
     return numberDeleted;



 Richard

 --
 Quis custodiet ipsos custodes





 --
 Quis custodiet ipsos custodes

 




-- 
Nick Johnson, App Engine Developer Programs Engineer
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
Number: 368047

--~--~-~--~~~---~--~~
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] Move sub-app to new appspot instance?

2009-07-15 Thread echeek

In my GAE development, I'm wondering if an offshoot sub-application of
my main application merits being an appspot instance of its own. The
new sub-application is related but doesn't share any data with the
primary app and could be used by other parties. Would moving this sub-
app to its own appspot instance violate the TOS?

Previous discussion considered unconclusively if a Facebook-clone
where various services (i.e. images, messaging, walls, etc.) are split
to different appspot instances would be allowed. This is similar to my
question however there is no data exchange in my situation.

--~--~-~--~~~---~--~~
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: Your application is exceeding a quota

2009-07-15 Thread richard emberson

Nick,

Again, thank you for your response.

Two Items

First Item:
Is there some Java API to the short term quotas so the I can
write code that knows how fast to go and when to stop?
If not, are the upload short term rate limits published
somewhere? Are they based on number of requests (which I can
control), number of bytes stored per minute (which I can
control), GAE cpu time (which I can not measure) or some
other measure?


Second Item:
Thanks for talking about the Python bulk loader. It gave me
an idea. Just as I extract data from the protocol layer without
creating any Entities, during a bulk load I can push data into
the protocol layer without creating any Entities.
As you know, an Entity only live in client application code and
during a bulk load there is no need to create any of them.
Each Entity has a map with String names and values. If you
have tens of thousands of these it really consumes CPU and
memory. So, just as I got a 20% performance improvement during
extraction, I expect to get an performance improvements
during loading.

Regards,

Richard


Nick Johnson (Google) wrote:
 On Wed, Jul 15, 2009 at 6:14 PM, richard
 embersonrichard.ember...@gmail.com wrote:
 Nick,

 Thank you for the response.

 I have tens of thousands of records to load. If I load them
 all at once or rate-limit the load, wont I run out of the
 short term quotas just the same? Or did you mean that I
 ought to rate-limit my load over a number of days or weeks?
 
 The problem you're running into is loading so rapidly you're hitting
 the very short term quotas intended to prevent you consuming all your
 daily quota at once. If you rate-limit enough, you can avoid hitting
 the short-term quotas while still staying within the daily quotas.
 Whether or not you need to rate limit enough to cover more than one
 day, or buy extra quota, is another issue.
 
 I am trying to determine if with large datasets, GAE is an
 adequate platform onto which the application I have in mind
 can be hosted. Currently, I am doing an evaluation. I've
 not yet built the application because I want to know if
 GAE has adequate performance.

 I've have already re-written the client-side code that
 extracts the data from the protocol layer and achieved a
 20% performance increase over the shipped 1.2.2 sdk on the
 production GAE server (my new code was only 12% to 15%
 faster on the
 local development server so 20% was unexpected).
 So, performance is critical for me - performance against
 large dataset.

 I don't know if the Python bulkloader will be an improvement.
 I ship the data up as csv blocks with are parsed into Entities
 and then stored. Pretty simple.
 
 The Python bulk loader does all the translation into entities on the
 client side, and then uses remote_api to send the encoded data over.
 This inevitably leads to less CPU utilization than parsing it yourself
 on the server. Nevertheless, the main reason I recommended the Python
 bulk loader is because it has support for concurrency and
 rate-limiting built right in.
 
 Concerning the speed of deleting existing data. You suggested
 using key-only queries. In my initial email that you responded
 to, I had a short code snippet where, in deed, I set the
 query to use keys only. So, was the code incorrect?
 
 Sorry, I didn't read the snippet in enough detail.
 
 -Nick Johnson
 
 Richard Emberson


 Nick Johnson (Google) wrote:
 Hi Richard,

 You're running into short term quotas, which are designed to prevent
 you exhausting your entire quota for the day in one go. You need to
 rate-limit your bulk loading code, and/or pay for additional quota.
 Even enabling billing without setting a high limit will increase your
 short term quotas automatically.

 You should also look at your bulk loading code and make sure it's as
 efficient as possible. One possibility is to use the Python
 bulkloader.

 As far as deletion goes, make sure you are doing key-only queries to
 get the key to delete, which will save on CPU time and timeouts.

 -Nick Johnson

 On Wed, Jul 15, 2009 at 12:11 AM, richard
 embersonrichard.ember...@gmail.com wrote:
 So, once again, I've tried to upload some data.

 After a couple, I guess, thousand records I start
 getting HttpServletResponse.SC_FORBIDDEN from
 the app engine server.

 On the Dashboard it says:

 Your application is exceeding a quota: CPU Time
 Your application is exceeding a quota: Datastore CPU Time

 but under Resource, CPU Time usage is at 34%
 and Stored Data usage is at 4%.

 I am trying to develop an application on GAE.
 I will need to load tens of thousands or
 a couple of hundred thousand entities as part
 of testing the application. I will then want
 to delete those entities.

 Currently, I can only load a couple of hundred
 before the app engine starts rejecting additional
 uploads. And I can not delete any of them - I
 keep getting timeouts - even if I try to delete only
 10.

 Is there some upload per minute quota or something?
 And, whats the magic to 

[google-appengine] Re: Move sub-app to new appspot instance?

2009-07-15 Thread Tony

Ultimately the question the TOS is asking is: are multiple appspot
apps being used to circumvent quotas/limits?

It would seem to me that a facebook-clone app like you describe would
see considerable savings by splitting into multiple apps (because of
the free quota allotted to each app), which I imaging Google would
frown upon.  However, if your subapp has different requirements that
might justify it being moved to a new app id (for example, a different
group of developers who shouldn't have access to the main app's
dashboard, etc), you might get some leniency.

On Jul 15, 12:00 pm, echeek xaviereni...@gmail.com wrote:
 In my GAE development, I'm wondering if an offshoot sub-application of
 my main application merits being an appspot instance of its own. The
 new sub-application is related but doesn't share any data with the
 primary app and could be used by other parties. Would moving this sub-
 app to its own appspot instance violate the TOS?

 Previous discussion considered unconclusively if a Facebook-clone
 where various services (i.e. images, messaging, walls, etc.) are split
 to different appspot instances would be allowed. This is similar to my
 question however there is no data exchange in my situation.
--~--~-~--~~~---~--~~
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] Application Main Logs severity level

2009-07-15 Thread richard emberson


The severity levels in the log viewer are:
DEBUG
INFO
WARNING
ERROR
CRITICAL

The Java logger has levels:

FINEST
FINER
FINE
CONFIG
INFO
WARNING
SEVERE

What is the mapping between the two?
Thanks

Richard

-- 
Quis custodiet ipsos custodes

--~--~-~--~~~---~--~~
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: Errors and quotas..

2009-07-15 Thread Tony

Yes.  You pay for all CPU cycles used, and all requests count toward
your request total.

On Jul 15, 2:22 pm, bvelasquez bvelasq...@gmail.com wrote:
 Hello,

 I'm curious if returning an error on a request still counts towards
 your quota?  I have a request that is being made, which is not
 authorized based on my sites security.  I return an error
 immediately.  However, does this request still count?  Could someone
 basically make repeated requests to your site and artificially inflate
 the cost of the application by using more CPU cycles than would
 normally be used?

 Thank you,

 Barry
--~--~-~--~~~---~--~~
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] Wanted: GAE/Python rockstar

2009-07-15 Thread mytemp

Looking for rockstar Python developers that are fast and can take an
idea (with some detail) to something working very quickly, even better
if they know how to make it pretty and do front-end work to so I don't
need a designer right off the bat.

Prefer experience with merchant account integration as well as web
services APIs (google, twitter, FB, youtube)...  even better if you
are in the SF bay area so we can meet in person, but that's not a
requirement.  Do want someone that just get's it and doesn't need a
lot of hand holding to make good decisions.

Please send me your hourly compensation requirements and sample work
(not just web site, but what you did, info on how long it took, etc).

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] Application Main Logs not working

2009-07-15 Thread richard emberson


When I send in a request that ought to log something
at the INFO level, nothing shows up in the Log viewer.

When I make some requests I get a 500 response code,
internal server error, but nothing shows up in the
Log viewer. So, I can not tell what the problem is.

Richard
-- 
Quis custodiet ipsos custodes

--~--~-~--~~~---~--~~
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: Webservice authentication (Python)

2009-07-15 Thread epb

I can see why Tony's version would work. His algorithm has two
steps:

1. Get the authorization token using ClientLogin (which I also managed
to do).
2. Use the uri servername/_ah/login to get the auth. cookie.

The appengine_rpc module seems to do authentication in a similar way:

A. Try to access the app. This results in a redirect to a location
that starts with https://www.google.com/accounts/ServiceLogin
B. Get a auth. token (like step 1 above)
C. Use auth. token to get auth. cookie.
D. Try to access the app. again (this is where it fails in my case...)

Anyway, step C is performed using the function below:

---

def _GetAuthCookie(self, auth_token):
Fetches authentication cookies for an authentication token.

Args:
  auth_token: The authentication token returned by ClientLogin.

Raises:
  HTTPError: If there was an error fetching the authentication
cookies.

continue_location = http://localhost/;
args = {continue: continue_location, auth: auth_token}
login_path = os.environ.get(APPCFG_LOGIN_PATH, /_ah)
req = self._CreateRequest(%s://%s%s/login?%s %
  (self.scheme, self.host, login_path,
   urllib.urlencode(args)))
try:
  response = self.opener.open(req)
except urllib2.HTTPError, e:
  response = e
if (response.code != 302 or
response.info()[location] != continue_location):
  raise urllib2.HTTPError(req.get_full_url(), response.code,
response.msg,
  response.headers, response.fp)
self.authenticated = True

--

It seems to me, that we do nothing with the response in this
function?? Shouldn't we save the cookie in the response like Tony's
does above, and then use it when we try to log in again?

On Jul 15, 1:06 pm, epb esbenbu...@gmail.com wrote:
 Thanks for your answers.

 As I understand Nick's response, I only need to use appengine_rpc.py
 for the entire process. I tried the following:

 ---

 def passwdFunc():
     return ('my_email','my_passwd')

 rpcServer = appengine_rpc.HttpRpcServer
 ('myapp.appspot.com',passwdFunc,None,'myAppName')
 blah = rpcServer.Send('/')

 ---

 This gave me a 302 error and the following log:

 ---

 Server: myapp.appspot.com
 Sending HTTP request:
 POST /? HTTP/1.1
 Host: myapp.appspot.com
 X-appcfg-api-version: 1
 Content-type: application/octet-stream

 Got http error, this is try #1
 Got 302 redirect. 
 Location:https://www.google.com/accounts/ServiceLogin?service=ahcontinue=http...
 nue%3Dhttp://myapp.appspot.com/
 ltmpl=gmahname=MyAppNamesig=46378246321321312
 Sending HTTP request:
 POST /? HTTP/1.1
 Host: myapp.appspot.com
 X-appcfg-api-version: 1
 Content-type: application/octet-stream

 Got http error, this is try #2

 ---

 It seems to me that the Send() function should do all authentication-
 work automatically and re-direct to the app page after logging in.
 Right?

 Anyway, I'll try out Tonys solution also..

 On Jul 15, 11:18 am, Tony fatd...@gmail.com wrote:

  Since I happened to have this up, here's a bit of sample code to get
  an authentication cookie for an appspot app...

  from google.appengine.api import urlfetch
  from urllib import urlencode
  email = request.POST['username']
  passwd = request.POST['password']
  serv_root = http://myapp.appspot.com;
  target = 'http://myapp.appspot.com/null'
  app_name = myapp-1.0
  auth_uri = 'https://www.google.com/accounts/ClientLogin'
  authreq_data = urlencode({ Email:   email,
                                    Passwd:  passwd,
                                    service: ah,
                                    source:  app_name,
                                    accountType: HOSTED_OR_GOOGLE })
  result = urlfetch.fetch(auth_uri, authreq_data, method=urlfetch.POST,
  follow_redirects=False)
  auth_dict = dict(x.split(=) for x in result.content.split(\n) if
  x)
  auth_token = auth_dict[Auth]
  serv_args = {}
  serv_args['continue'] = target
  serv_args['auth']     = auth_token
  serv_uri = %s/_ah/login?%s % (serv_root, urlencode(serv_args))
  result2 = urlfetch.fetch(serv_uri, follow_redirects=False,
  method=urlfetch.GET)
  ### here's the cookie which will authenticate future requests
  cookie = result2.headers['set-cookie'].split(';')[0]
  # cookie[0] = ACSID
  # cookie[1] = HFSDJHSDFHSDJFHSDJFHSJFSDfsdjfhsjdfhsjdfh...
--~--~-~--~~~---~--~~
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: Your application is exceeding a quota

2009-07-15 Thread Nick Johnson (Google)

On Wed, Jul 15, 2009 at 7:03 PM, richard
embersonrichard.ember...@gmail.com wrote:

 Nick,

 Again, thank you for your response.

 Two Items

 First Item:
 Is there some Java API to the short term quotas so the I can
 write code that knows how fast to go and when to stop?
 If not, are the upload short term rate limits published
 somewhere? Are they based on number of requests (which I can
 control), number of bytes stored per minute (which I can
 control), GAE cpu time (which I can not measure) or some
 other measure?

Not currently, no. Your best bet is to write your uploader to run
until it gets over quota errors, then back off a bit. The rates apply
to all the quotas that are accounted for on App Engine, and constitute
a fraction of your available daily quota for each. Increasing your
daily limits through billing will also increase the short-term
buckets. In some cases, simply enabling billing raises the limits.



 Second Item:
 Thanks for talking about the Python bulk loader. It gave me
 an idea. Just as I extract data from the protocol layer without
 creating any Entities, during a bulk load I can push data into
 the protocol layer without creating any Entities.
 As you know, an Entity only live in client application code and
 during a bulk load there is no need to create any of them.
 Each Entity has a map with String names and values. If you
 have tens of thousands of these it really consumes CPU and
 memory. So, just as I got a 20% performance improvement during
 extraction, I expect to get an performance improvements
 during loading.

This is exactly how remote_api works, which the Bulk Loader uses.

-Nick Johnson


 Regards,

 Richard


 Nick Johnson (Google) wrote:
 On Wed, Jul 15, 2009 at 6:14 PM, richard
 embersonrichard.ember...@gmail.com wrote:
 Nick,

 Thank you for the response.

 I have tens of thousands of records to load. If I load them
 all at once or rate-limit the load, wont I run out of the
 short term quotas just the same? Or did you mean that I
 ought to rate-limit my load over a number of days or weeks?

 The problem you're running into is loading so rapidly you're hitting
 the very short term quotas intended to prevent you consuming all your
 daily quota at once. If you rate-limit enough, you can avoid hitting
 the short-term quotas while still staying within the daily quotas.
 Whether or not you need to rate limit enough to cover more than one
 day, or buy extra quota, is another issue.

 I am trying to determine if with large datasets, GAE is an
 adequate platform onto which the application I have in mind
 can be hosted. Currently, I am doing an evaluation. I've
 not yet built the application because I want to know if
 GAE has adequate performance.

 I've have already re-written the client-side code that
 extracts the data from the protocol layer and achieved a
 20% performance increase over the shipped 1.2.2 sdk on the
 production GAE server (my new code was only 12% to 15%
 faster on the
 local development server so 20% was unexpected).
 So, performance is critical for me - performance against
 large dataset.

 I don't know if the Python bulkloader will be an improvement.
 I ship the data up as csv blocks with are parsed into Entities
 and then stored. Pretty simple.

 The Python bulk loader does all the translation into entities on the
 client side, and then uses remote_api to send the encoded data over.
 This inevitably leads to less CPU utilization than parsing it yourself
 on the server. Nevertheless, the main reason I recommended the Python
 bulk loader is because it has support for concurrency and
 rate-limiting built right in.

 Concerning the speed of deleting existing data. You suggested
 using key-only queries. In my initial email that you responded
 to, I had a short code snippet where, in deed, I set the
 query to use keys only. So, was the code incorrect?

 Sorry, I didn't read the snippet in enough detail.

 -Nick Johnson

 Richard Emberson


 Nick Johnson (Google) wrote:
 Hi Richard,

 You're running into short term quotas, which are designed to prevent
 you exhausting your entire quota for the day in one go. You need to
 rate-limit your bulk loading code, and/or pay for additional quota.
 Even enabling billing without setting a high limit will increase your
 short term quotas automatically.

 You should also look at your bulk loading code and make sure it's as
 efficient as possible. One possibility is to use the Python
 bulkloader.

 As far as deletion goes, make sure you are doing key-only queries to
 get the key to delete, which will save on CPU time and timeouts.

 -Nick Johnson

 On Wed, Jul 15, 2009 at 12:11 AM, richard
 embersonrichard.ember...@gmail.com wrote:
 So, once again, I've tried to upload some data.

 After a couple, I guess, thousand records I start
 getting HttpServletResponse.SC_FORBIDDEN from
 the app engine server.

 On the Dashboard it says:

 Your application is exceeding a quota: CPU Time
 Your application is exceeding a quota: 

[google-appengine] Re: Webservice authentication (Python)

2009-07-15 Thread Tony

The response has the Set-cookie header set, which will cause the
user's browser to save the cookie and then present it on the next
request (after redirected by the 302).  In my code I've opted not to
follow the redirect, and extracted the cookie myself, because it's the
urlfetch service doing the request, not the user.  You can then either
return a response to the user with a Set-cookie HTTP header (causing
their browser to save the cookie), or handle it some other way (return
it in the body and set the cookie with Javascript, for example).

I think I misunderstood your original question, though, and you're
looking for something different.  You want to get an authorization
cookie and then use it to make repeated requests with urlfetch, not
with a browser?  If that's the case, you're going to want to capture
the Set-cookie header from the second response, and supply that in
future requests (setting the Cookie header for urlfetch).

Basically, urlfetch will follow redirects but it won't handle cookies
automatically - so what's happening is it's ignoring the Set-cookie
header and following the redirect, and being denied because it's not
supplying a cookie.


On Jul 15, 2:58 pm, epb esbenbu...@gmail.com wrote:
 I can see why Tony's version would work. His algorithm has two
 steps:

 1. Get the authorization token using ClientLogin (which I also managed
 to do).
 2. Use the uri servername/_ah/login to get the auth. cookie.

 The appengine_rpc module seems to do authentication in a similar way:

 A. Try to access the app. This results in a redirect to a location
 that starts withhttps://www.google.com/accounts/ServiceLogin
 B. Get a auth. token (like step 1 above)
 C. Use auth. token to get auth. cookie.
 D. Try to access the app. again (this is where it fails in my case...)

 Anyway, step C is performed using the function below:

 ---

 def _GetAuthCookie(self, auth_token):
     Fetches authentication cookies for an authentication token.

     Args:
       auth_token: The authentication token returned by ClientLogin.

     Raises:
       HTTPError: If there was an error fetching the authentication
 cookies.
     
     continue_location = http://localhost/;
     args = {continue: continue_location, auth: auth_token}
     login_path = os.environ.get(APPCFG_LOGIN_PATH, /_ah)
     req = self._CreateRequest(%s://%s%s/login?%s %
                               (self.scheme, self.host, login_path,
                                urllib.urlencode(args)))
     try:
       response = self.opener.open(req)
     except urllib2.HTTPError, e:
       response = e
     if (response.code != 302 or
         response.info()[location] != continue_location):
       raise urllib2.HTTPError(req.get_full_url(), response.code,
 response.msg,
                               response.headers, response.fp)
     self.authenticated = True

 --

 It seems to me, that we do nothing with the response in this
 function?? Shouldn't we save the cookie in the response like Tony's
 does above, and then use it when we try to log in again?

 On Jul 15, 1:06 pm, epb esbenbu...@gmail.com wrote:

  Thanks for your answers.

  As I understand Nick's response, I only need to use appengine_rpc.py
  for the entire process. I tried the following:

  ---

  def passwdFunc():
      return ('my_email','my_passwd')

  rpcServer = appengine_rpc.HttpRpcServer
  ('myapp.appspot.com',passwdFunc,None,'myAppName')
  blah = rpcServer.Send('/')

  ---

  This gave me a 302 error and the following log:

  ---

  Server: myapp.appspot.com
  Sending HTTP request:
  POST /? HTTP/1.1
  Host: myapp.appspot.com
  X-appcfg-api-version: 1
  Content-type: application/octet-stream

  Got http error, this is try #1
  Got 302 redirect. 
  Location:https://www.google.com/accounts/ServiceLogin?service=ahcontinue=http...
  nue%3Dhttp://myapp.appspot.com/
  ltmpl=gmahname=MyAppNamesig=46378246321321312
  Sending HTTP request:
  POST /? HTTP/1.1
  Host: myapp.appspot.com
  X-appcfg-api-version: 1
  Content-type: application/octet-stream

  Got http error, this is try #2

  ---

  It seems to me that the Send() function should do all authentication-
  work automatically and re-direct to the app page after logging in.
  Right?

  Anyway, I'll try out Tonys solution also..

  On Jul 15, 11:18 am, Tony fatd...@gmail.com wrote:

   Since I happened to have this up, here's a bit of sample code to get
   an authentication cookie for an appspot app...

   from google.appengine.api import urlfetch
   from urllib import urlencode
   email = request.POST['username']
   passwd = request.POST['password']
   serv_root = http://myapp.appspot.com;
   target = 'http://myapp.appspot.com/null'
   app_name = myapp-1.0
   auth_uri = 'https://www.google.com/accounts/ClientLogin'
   authreq_data = urlencode({ Email:   email,
                                     Passwd:  passwd,
                                     service: ah,
                                     source:  app_name,
 

[google-appengine] Re: Webservice authentication (Python)

2009-07-15 Thread Tony

I believe that the difference between urlfetch and urllib2 is
superficial - App Engine makes all requests using urlfetch, regardless
of which lib you use in your code.

On Jul 15, 4:55 pm, epb esbenbu...@gmail.com wrote:
 On Jul 15, 4:05 pm, Tony fatd...@gmail.com wrote:

  The response has the Set-cookie header set, which will cause the
  user's browser to save the cookie and then present it on the next
  request (after redirected by the 302).  In my code I've opted not to
  follow the redirect, and extracted the cookie myself, because it's the
  urlfetch service doing the request, not the user.  You can then either
  return a response to the user with a Set-cookie HTTP header (causing
  their browser to save the cookie), or handle it some other way (return
  it in the body and set the cookie with Javascript, for example).

  I think I misunderstood your original question, though, and you're
  looking for something different.  You want to get an authorization
  cookie and then use it to make repeated requests with urlfetch, not
  with a browser?  If that's the case, you're going to want to capture
  the Set-cookie header from the second response, and supply that in
  future requests (setting the Cookie header for urlfetch).

 Yes, that is exactly what I want :) My client app. is not browser-
 based. I guess I'll just use your method then.. appengine_rpc must be
 intended for browser apps only, as it does nothing to capture the
 auth. cookie. I could of course extend the appengine_rpc module to
 capture the cookie, but the module uses urllib2.OpenerDirector.open()
 to open URLs and this is perhaps not the way to go in my case? I am
 not sure what the difference is between urlfetch() and open() it
 seems like I can get the headers (and hereby the cookie) by using info
 () on the response from open().



  Basically, urlfetch will follow redirects but it won't handle cookies
  automatically - so what's happening is it's ignoring the Set-cookie
  header and following the redirect, and being denied because it's not
  supplying a cookie.

  On Jul 15, 2:58 pm, epb esbenbu...@gmail.com wrote:

   I can see why Tony's version would work. His algorithm has two
   steps:

   1. Get the authorization token using ClientLogin (which I also managed
   to do).
   2. Use the uri servername/_ah/login to get the auth. cookie.

   The appengine_rpc module seems to do authentication in a similar way:

   A. Try to access the app. This results in a redirect to a location
   that starts withhttps://www.google.com/accounts/ServiceLogin
   B. Get a auth. token (like step 1 above)
   C. Use auth. token to get auth. cookie.
   D. Try to access the app. again (this is where it fails in my case...)

   Anyway, step C is performed using the function below:

   ---

   def _GetAuthCookie(self, auth_token):
       Fetches authentication cookies for an authentication token.

       Args:
         auth_token: The authentication token returned by ClientLogin.

       Raises:
         HTTPError: If there was an error fetching the authentication
   cookies.
       
       continue_location = http://localhost/;
       args = {continue: continue_location, auth: auth_token}
       login_path = os.environ.get(APPCFG_LOGIN_PATH, /_ah)
       req = self._CreateRequest(%s://%s%s/login?%s %
                                 (self.scheme, self.host, login_path,
                                  urllib.urlencode(args)))
       try:
         response = self.opener.open(req)
       except urllib2.HTTPError, e:
         response = e
       if (response.code != 302 or
           response.info()[location] != continue_location):
         raise urllib2.HTTPError(req.get_full_url(), response.code,
   response.msg,
                                 response.headers, response.fp)
       self.authenticated = True

   --

   It seems to me, that we do nothing with the response in this
   function?? Shouldn't we save the cookie in the response like Tony's
   does above, and then use it when we try to log in again?

   On Jul 15, 1:06 pm, epb esbenbu...@gmail.com wrote:

Thanks for your answers.

As I understand Nick's response, I only need to use appengine_rpc.py
for the entire process. I tried the following:

---

def passwdFunc():
    return ('my_email','my_passwd')

rpcServer = appengine_rpc.HttpRpcServer
('myapp.appspot.com',passwdFunc,None,'myAppName')
blah = rpcServer.Send('/')

---

This gave me a 302 error and the following log:

---

Server: myapp.appspot.com
Sending HTTP request:
POST /? HTTP/1.1
Host: myapp.appspot.com
X-appcfg-api-version: 1
Content-type: application/octet-stream

Got http error, this is try #1
Got 302 redirect. 
Location:https://www.google.com/accounts/ServiceLogin?service=ahcontinue=http...
nue%3Dhttp://myapp.appspot.com/
ltmpl=gmahname=MyAppNamesig=46378246321321312
Sending HTTP request:
POST /? HTTP/1.1
  

[google-appengine] Re: sendmail InvalidSenderError

2009-07-15 Thread thebrianschott

Wooble,

Thanx, I did not realize that sendmail
has that limitation. Is there a workaround
within the gae, or do I need to revise the
instructions to my app to tell users that
they will need to forward messages from
within their gmail account?

Brian
--~--~-~--~~~---~--~~
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] Quota changes keep on getting canceled by Google checkout

2009-07-15 Thread dplouffe

Hi all,

I want to increase my quotas and do so from the Billing Settings
section of the admin interface.  I go through the Google Checkout
process without any issues.  When I check my inbox I get two emails,
one confirming my new order and another one stating that my order has
been canceled.  There doesn't seem to be any reasons in the email or
in my Billing History as per why that is.

Anyone can help me find out why my order keeps on getting canceled?

Cheers,

Dominic

--~--~-~--~~~---~--~~
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: Wanted: GAE/Python rockstar

2009-07-15 Thread RockstarDev

It's pieces of sh*t like you who give this industry a bad name. All
you want is a mule to abuse. Go away and find another industry to rape
c*ck gobbler!! Shoo!!



On Jul 15, 1:35 pm, mytemp mytempjunkm...@gmail.com wrote:
 Looking for rockstar Python developers that are fast and can take an
 idea (with some detail) to something working very quickly, even better
 if they know how to make it pretty and do front-end work to so I don't
 need a designer right off the bat.

 Prefer experience with merchant account integration as well as web
 services APIs (google, twitter, FB, youtube)...  even better if you
 are in the SF bay area so we can meet in person, but that's not a
 requirement.  Do want someone that just get's it and doesn't need a
 lot of hand holding to make good decisions.

 Please send me your hourly compensation requirements and sample work
 (not just web site, but what you did, info on how long it took, etc).

 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: sendmail InvalidSenderError

2009-07-15 Thread Tony

The FROM address must either be a.) the currently logged in user, or
b.) a registered admin of the app.  If you want to get around that
limitation, you'll have to utilize a service external to GAE.

On Jul 15, 6:02 pm, thebrianschott schott.br...@gmail.com wrote:
 Wooble,

 Thanx, I did not realize that sendmail
 has that limitation. Is there a workaround
 within the gae, or do I need to revise the
 instructions to my app to tell users that
 they will need to forward messages from
 within their gmail account?

 Brian
--~--~-~--~~~---~--~~
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] task queue: admin-only URLs don't retry after HTTP error?

2009-07-15 Thread Dan

Hello,
I need to make the task-queue worker URLs accessible only to the task
queue, and not to people who happen to guess the URL but are not
administrators. Unfortunately, the access restriction option appears
to mess up the retry mechanism of the task queue.

Base scenario: with no changes to my app.yaml, I can test the task
queue using the SDK and verify that the workers are doing the right
thing when I tell each task to Run. If there is a problem while a
worker runs a tasks, it generates a HTTP 500 error, and the task is
not cleared from the queue. this is good behavior that I want to see
when I restrict the worker URL to admin using app.yaml, but it
doesn't turn out to be the case for me.

These are the lines added to my app.yaml:

- url: /init/post_process_data/new_row_notify_handler
  login: admin
  script: gaehandler.py   # note that I'm using web2py
  secure: optional

and I can verify that the access restriction has taken effect because
when I go to the worker URL, I get redirected to a login page which
says that I am Not logged in. And when I try to run a task in the
queue using the admin console, it does get triggered correctly. But
when the worker generates a 500 error, the task is mistakenly removed
from the queue.

Perhaps my configuration is incorrect? Or could this be a bug?

Dan

ps- This thread has some similar discussion:
http://groups.google.com/group/google-appengine/browse_thread/thread/89573a9d573ee6c/8dc5579764c2a4e0?hl=enlnk=gstq=taskqueue+admin#
--~--~-~--~~~---~--~~
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] simultaneous dynamic requests, max blob size, multi-blob?

2009-07-15 Thread Jeff Enderwick

1) I saw that 30 was listed somewhere as the max simultaneous dynamic
requests for an app. Is this really true? Even if I am paying, and I
have a very popular app? I see the math indicating that one can retire
400/sec with 75ms latency, but I am sure that GOOG-internal apps
aren't held to this limit of 30. Is this really a hard limit?

2) Great to see that Service for storing and serving large files is
on deck. Can y'all give any indication whether this will be
accomplished by making blobs bigger (or adding some sort of uberblob)?
Any indications on new max size would be great.

3) Along those lines, has anyone implemented something like multi-blob
fragmentation/reassembly for storing  serving things greater than
1MB?

Thanks!
Jeff

--~--~-~--~~~---~--~~
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: simultaneous dynamic requests, max blob size, multi-blob?

2009-07-15 Thread Tony

I'm pretty sure #1 is correct.  Of course, it's not a hard limit in
the sense that the 31st request is dropped, rather it's queued, but
yes it's unfortunate.

On Jul 15, 10:33 pm, Jeff Enderwick jeff.enderw...@gmail.com wrote:
 1) I saw that 30 was listed somewhere as the max simultaneous dynamic
 requests for an app. Is this really true? Even if I am paying, and I
 have a very popular app? I see the math indicating that one can retire
 400/sec with 75ms latency, but I am sure that GOOG-internal apps
 aren't held to this limit of 30. Is this really a hard limit?

 2) Great to see that Service for storing and serving large files is
 on deck. Can y'all give any indication whether this will be
 accomplished by making blobs bigger (or adding some sort of uberblob)?
 Any indications on new max size would be great.

 3) Along those lines, has anyone implemented something like multi-blob
 fragmentation/reassembly for storing  serving things greater than
 1MB?

 Thanks!
 Jeff
--~--~-~--~~~---~--~~
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: Wanted: GAE/Python rockstar

2009-07-15 Thread Andrew Badera
Is there a story, here, or just a random outburst? I've certainly been
shopped on this list previously, had my time wasted and my expertise stolen
by the likes of Twittertise  its 'creator' ... but you don't see me
attacking everyone coming here looking for a developer.

Thanks-
- Andy Badera
- and...@badera.us
- Google me: http://www.google.com/search?q=andrew+badera
- This email is: [ ] bloggable [x] ask first [ ] private


On Wed, Jul 15, 2009 at 4:13 PM, RockstarDev craig...@gmail.com wrote:


 It's pieces of sh*t like you who give this industry a bad name. All
 you want is a mule to abuse. Go away and find another industry to rape
 c*ck gobbler!! Shoo!!



 On Jul 15, 1:35 pm, mytemp mytempjunkm...@gmail.com wrote:
  Looking for rockstar Python developers that are fast and can take an
  idea (with some detail) to something working very quickly, even better
  if they know how to make it pretty and do front-end work to so I don't
  need a designer right off the bat.
 
  Prefer experience with merchant account integration as well as web
  services APIs (google, twitter, FB, youtube)...  even better if you
  are in the SF bay area so we can meet in person, but that's not a
  requirement.  Do want someone that just get's it and doesn't need a
  lot of hand holding to make good decisions.
 
  Please send me your hourly compensation requirements and sample work
  (not just web site, but what you did, info on how long it took, etc).
 
  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: Need input: developers and Azure VS GAE

2009-07-15 Thread Andrew Badera
On Wed, Jul 15, 2009 at 8:40 PM, Adam adam.crossl...@gmail.com wrote:


 On Jul 15, 2:08 pm, mytemp mytempjunkm...@gmail.com wrote:
 
  So, if I had access to a rockstar Python/GAE person (or two)... at a
  reasonable price, I think I'd just go GAE.  Anyone?

 I definitely agree with this. All other things being equal, I'd say
 the AppEngine is the better deal. From my experience here in the
 Boston area, a talented Python programmer can be had at a lower rate
 than a similar .NET consultant. Of course, the number of Python
 consultants who also know AppEngine very well is going to be quite
 small.


Again ... have to dispute some stats here. Python programmers, according to
many national surveys, earn just about the highest freelance wages out there
-- more than Java or .NET by about $10/hour or more. And I'm a strong C#/
ASP.NET guy myself -- .NET butters my bread -- but Python, in a market where
Python is being used for a business purpose, pays better than .NET.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---