« View From My Screen | Main | Aha »

April 09, 2008

Getting Started on Google App Engine with Flex and PyAMF (1)

So this is my first of hopefully two posts on getting setup to work on Google App Engine. This will get your python and local google server up and running

1. Download and install python if you need to.

2. Download and install the google app engine sdk. I recommend installing this somewhere on your system that is easily accessible. By default on windows it went under /program files/google/appengine. I reinstalled it under c:/appengine/ for easy access from the command prompt. Do as you will but remember where it gets put.

3. Install pydev into your eclipse. There’s a great getting started guide for pydev located here. It explains how to set your python interpreter up.  

To add code complete support for the google sdk in eclipse first zip up the google directory in your appengine installation directory. Then go to windows > prefs > PyDev > Interpretor : System PYTHONPATH click “New Egg/Zip” and add that google.zip

UPDATE: The crossed out steps are better explained by this post  about getting your debugger up and running in eclipse.

4. Create a new PyDev project. Finish. 

5. Now browse to your appengine installation directory and copy / paste the new_project_template into the same directory. Then rename it to the name of  your project.

6. And now back in eclipse right click on the src folder and do a add new folder > advanced > Link to the file system and browse to the project folder under your appengine installation.

7. Open app.yaml on the top line change the application: new-project-template to application : your-app-name

 

Now open a command prompt and go to your appengine isntallation directory and type dev_appserver.py —port=9999 {YOUR APP FOLDER NAME}

Then open a browser and go to http://localhost:9999/ and you should see it running.

 

Installing PyAMF and Setting up flex environment next.

 

 

 

 

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/t/trackback/2357234/27958968

Listed below are links to weblogs that reference Getting Started on Google App Engine with Flex and PyAMF (1):

Comments

So far, so good. However, when i try yo run the project in Eclipse, it says:

Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\test2\main.py", line 24, in
from google.appengine.ext import webapp
File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py"
, line 68, in
import webob
ImportError: No module named webob

Why? How can I fix this?

@kalina,

There's a reference error taking place. Make sure you have added the google code to your python path in windows > prefs > PyDEV. Also, read my article about setting up debugging. it can be found here http://blog.smashedapples.com/2008/04/debugging-googl.html. Finally, check the wiki page by the PyAMF guys here: http://pyamf.org/wiki/GoogleAppEngine. It's the most up to date resource.

My PYTHONPATH is congigured just as it is in your debugging post. Runnung the http://localhost:9999/ from the command prompt in the appengine directory does provide the Hello World! message in the browser.

Only, running it through Eclipse Run -> Run as -> 4. Python Run shows the message pasted above. What else, other than the google reference could be missing/corrupted?

As for PyAMF- I'm not quite there yet :). I want to get this thing going first.

By the way, as for the "easy access from the command prompt" CmdHere has done wonders for me - http://www.commandline.co.uk/cmdhere/index.html

You can't directly run a file like main.py, or I don't know how to do that yet. Anyways, you want to debug it in the same environment it'll run under so you need to debug the dev_appserver.py file and it should work fine. Make sure you fill your arguments in. You determine what file you want to run by using the app.yaml and your browser url to invoke the right file just like a webserver. The good news is, that once you start debugging the dev_appserver.py file you can make changes to your directory and just reload your browser to debug.

I've installed PyDEV into Flex Builder, but keep getting the following error when I try to configure the Python interpreter:

"No output was in the standard output when trying to create the interpreter info. The error output contains:>>/System/Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python: can't open file "'/Applications/Adobe': [Errno 2] No such file or directory <<

Any thoughts? FYI - I'm browsing to the current Python executable and The /Applications/Adobe directory does exist...

@Martin, I'm not sure. I use eclipse. And actually, I don't mix my flex installed eclipse with other installations of eclipse for reasons of insanity like what you're seeing. I'd recommend downloading the stand alone eclipse and trying to set PyDev up by itself. Sorry I couldn't help more.

Post a comment

If you have a TypeKey or TypePad account, please Sign In