Saturday, July 26, 2008

The Development Console for Google App Engine

Ok; now we are going to work seriously! (I hope so). I'm back from a small vacation and I'm upping for something special now. A nice guy already posted a comment and seems to be interested on the Google App Engine Server. Ohh; I think I have to start serious work on it :)

Now let's focus on the Google App Engine development console. Ok there's no much to see on it. (if you dare to compare it to the ASP.net administrator tools :( )
But I already loved a tool on it and I'll introduce it.

Now run your server; choose any application that doesn't bother.
Then open the following link 'http://localhost:8080/_ah/admin' You should see the admin console. As I said there's no much to see. Forget about the 'Data Store Viewer' and have a look on the 'interactive console'

What's cool on this console
  • Run quickly your test code
  • Check a few lines and find the error easily
  • Good for newbie and learner!
Here's the default code on it.

# Say hello to the current user
user = users.get_current_user()
if user:
nickname = user.nickname()
else:
nickname = "guest"
print "Hello, " + nickname

now try to make a change like deleting the word users in users.get_current_ser()
here's the error message
Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\google\appengine\ext\admin\__init__.py", line 179, in post
compiled_code = compile(code, '', 'exec')
File "", line 2
user = .get_current_user()
^
SyntaxError: invalid syntax

Sounds cool no?
Now you may wonder what this sample does. Ok, simply, if you are logged to Google account then it'll display your name. If not then it'll display "guest"!
But where to login? Ohh here's the page http://localhost:8080/_ah/login

Your users are not obliged to redirect to that page to login; you can integrate it on your own site!
You may wonder why it don't asks for a password; that's simple; because you work on local, then Google won't query its' database if you are working on local.

No comments:

Interested on Microsoft Technologies? Read Visual Studio Dot Net