1) you have never installed python platform before.
2) you are new to Google App Engine.
3) you are running windows. if you are running Linux – the process is different. And please refer this for getting started.
4) you have a Google account.
Ok. So let’s get started with developing a hello world python app on windows first and then upload that app to Google App Engine.
1. Get the python development environment for windows.
I opted for Active state python community edition which you can download from: http://www.activestate.com/activepython/downloads
2. Install Google app engine SDK for python.
The second step is to download the Google App Engine SDK for python on windows which you can download from: http://code.google.com/appengine/downloads.html
3. Create an Application on Google and get the APP ID.
Now, let’s sign up for a Google App Engine Account with a Google account you may have. Part of the process includes verification via a code sent to your mobile device – so be ready to provide your mobile number. And every Google Account gets to deploy 10 applications with a Google App Engine admin account.
Now, sign in with your Google account and you would be asked to verify your account:
FAQ for this process is here: http://code.google.com/appengine/kb/sms.html
Now, once you successfully verify your account, you would see something like:
And click on create application and fill in the following details. For now, fill in the App ID and the App Title. Leave other options as default for now. And yes, please check the availability of your app id and this will also be your URL. The URL will take the form.appspot.com
Scroll down and you will find a “create application”. please click on it. You will also see a message: “Application registered successfully”. Now, let’s do some coding!
4. Let’s write the Hello World Python app!
create a directory and name it anything you like. I named it “parasdoshipyapp”. But remember the location of the directory – you need it later.
create a helloworld.py file inside the directory you just created. (you can edit it via notepad or pythonwin). And here is the demo code:
print ‘Content-Type: text/plain’
print ‘Hello, world!’
Now, you will need to create app.yaml file. Here is the demo code:
- url: /.*
In the first line, you add the app id (remember, we had created an application id in step 3)
And the last line is the file that has the code. In this case, the code is meant to print just couple of lines.
5. Test and upload on Google App Engine via Google App engine Launcher.
open Google App Engine Launcher:
Go to File –> create new application, and you will see:
Add the app id in the application name and the directory of your app. In my case, it is “parasdoshipyapp” and click on create.
Now let’s test it locally.
Click on “Run” to test it locally. Note the port no. In my case it is 8080 so I am going to go and open “http://localhost:8080/” on my browser:
It runs and so let’s deploy it on cloud (Google App Engine)
click on “deploy” and enter your Google Account credentials. Note the projects field is your “App ID”
Now we you will see the progress of the deploy. Let it do it’s processing and when it has successfully deployed your app, go to the URL and check out your site! Also explore the application dashboard.
And here is a hello world app I deployed! URL: http://parasdoshipyapp.appspot.com/
So that’s about it. I played with Google app engine as a part of an assignment for my UW cloud computing certificate program and I thought about documenting the process so may be it can help someone. Also refer to Google App Engine Getting started documentation here: http://code.google.com/appengine/docs/whatisgoogleappengine.html
If you are searching for a tutorial to help you get started with Java on Google App Engine. Here’s the tutorial: Getting started with creating Java app on Google App engine – Guest Post by Dhwaneet Bhatt