All one can think and do in a short time is to think what one already knows and to do as one has always done!

Google App Engine Python Tutorial using Eclipse Plugin

In this tutorial, we will go thru the process of setting up Eclipse to create Python Web Project using Google App Engine SDK (GAE) then run it locally and also deploy it production basically to your Google App Engine account.

1) Google App Engine Registration

If you have already registered yourself with GAE then skip this step otherwise just
click on the link https://appengine.google.com/ and register yourself for GAE.

You can create up to 10 applications. Click on the Create Application button to create a new application. The application Id that you choose have to available as it creates a sub-domain for the appspot.com with that name so that you can access your application later using http://{your_app_Id}.appspot.com

2) Setup Eclipse for Python programming

Depending on what your current setup is you may have to download one or more of the following, Python Interpreter, Eclipse, Java and PyDev plugin for Python Eclipse development. If you already have this setup done just skip over to the next step otherwise follow this link:
Python beginner Tutorial using Eclipse PyDev Plugin

Important Note:The above tutorial downloads the Python 3.2 version, in your case download the Python 2.7 version as GAE currently doesn't support version 3.2

4) Hello World Project using Eclipse

Set the project name to HelloWorld and select the option "Create 'src' folder and add it to PYTHONPATH?". Click Next...

Click on the Browse Button and point it to where Google App Engine is installed on your computer.

Specify the same Application Id that you created in your Step 1. You can change the Application Id of the Project later in the config file. Also choose the "Hello Webapp World" template to generate our sample project.

5) Run our Hello World Application Locally

Right click on the helloworld.py file -> Run As –> Run Configuration. Create a new PyDev Google App Run launch configuration and name it Run Python Hello World. Also specify the Main Module as dev_appserver.py
It is available under the GAE installed directory, you have to type the path for some reason the Browse functionality doesn't work.

In Arguments tab for the Program arguments specify ${project_loc}/src. Click Run.

The application will deploy to port 8080 on the localhost. You can access it by typing http://localhost:8080/ on the browser.

Tip:To change the port to say 8081, you have to specify that in your program arguments.--port=8081 ${project_loc}/src

6) Modify our Hello World Application

The default template created uses webapp. We are going to changes that to use webapp2. webapp2 is part of the Python 2.7 runtime since App Engine SDK 1.6.0. webapp2 is a simple. It follows the simplicity of webapp, but improves it in some ways: it adds better URI routing and exception handling, a full featured response object and a more flexible dispatching mechanism.Copy the following source into your helloworld.py

There is no need to Run anything again. Just go the browser and hit refresh and you should see the changes to your application.

7) Deploy your application to Google App Engine

Right click on the helloworld.py file -> Run As –> Run Configuration. Create a new PyDev Google App Run launch configuration and name it Deploy Python Hello World. Also specify the Main Module as appcfg.py

In Arguments tab for the Program arguments specify update ${project_loc}/src. Click Run.

During the process it will ask you for your credentials to Google App Engine. Keep an eye on the console and enter your Email Address and password.