Hello World in Gae
Before reading this article, you must have read the previous post http://usepython.blogspot.com/2013/01/getting-started-with-app-engine-in.html .Without the previous post, you might not be able to test the example in this post. Okay, so by now, my assumption is that you have read the article mentioned and are ready to go on with me. So, lets start.
Open your favorite IDE, aptana ofcourse, which need not be your favorite IDE though. And lets create a new app engine Project. Goto File->New->Project. A pop up window should open, Now Click on PyDev to expand it and select PyDev Google App Engine Project, hit Next.
Now its time to put a name for the project. For me its will be higae.
A hello world app has been created. Now is the time we run the app. For the from PyDev Package Explorer , right click on the project folder, and then click on Run As-> 1 PyDev: GoogleApp Run.
The development console of the project can be accessed at http://localhost:8080/_ah/admin/ . So your million dollar project is ready, right?
So for our case, lets modify the application to say Hello MyName. Open helloworld.py file and change the third line :
Open your favorite IDE, aptana ofcourse, which need not be your favorite IDE though. And lets create a new app engine Project. Goto File->New->Project. A pop up window should open, Now Click on PyDev to expand it and select PyDev Google App Engine Project, hit Next.
Now its time to put a name for the project. For me its will be higae.
Okay, now the next step is to reference the google app engine directory for your project. For this, simply browse to the app engine directory, for me its C:\Program Files (x86)\Google\google_appengine and should be for you too.
Once you hit Ok. You will see.Hit OK again. and then a Next.
Now select a template. Its good to choose 'Hello Webapp World' template. Hit Finish.
A hello world app has been created. Now is the time we run the app. For the from PyDev Package Explorer , right click on the project folder, and then click on Run As-> 1 PyDev: GoogleApp Run.
Now the app engine should be running your hello world application. To see, it working open your favorite browser and open the url: http://localhost:8080 . In the browser windos, you should see,
Hello, World!
The development console of the project can be accessed at http://localhost:8080/_ah/admin/ . So your million dollar project is ready, right?
So for our case, lets modify the application to say Hello MyName. Open helloworld.py file and change the third line :
self.response.out.write('Hello, Webapp World!')to
self.response.out.write('Hello, Python!')and run the project again.It should have Hello, Python in the browser window.
Comments
Post a Comment