:::: MENU ::::

Develop Google AppEngine with Aptana Studio

Recently I have jumped on Python wagon to play with Google AppEngine a bit. Python is a very fun (and powerful) language and I feel so bad I never touched it before.

There are many editors for Mac OS to make coding in Python even more fun, TextMate and Coda to name a few, but it is not much productive. You need to code in the editor with no code completion for AppEngine SDK, then you need to start the local web sever in the terminal to test your code.

Aptana Studio in the other hand, provides you with a great user interface and many other features, all inherited from the mighty Eclipse. By installing PyDev plugin in the other hand,  you can make Aptana, Python friendly.

However, there are still 2 missing links in the chain of perfection to make Aptana the IDE of choice for developing for AppEngine: Code completion for Google libraries and built-in debugging facilities.

In this tutorial you are going see how to make Aptana Studio your one and only AppEngine development tool in Mac OS X.

Note: I assume that you have a basic idea of Python and Google AppEngine. You should be also comfortable using Mac and installing applications.

Getting Started

First you need to install AppEngine SDK on your Mac. Note that when you visit the download page of AppEngine there is a DMG package for Mac. First, you need to download and install it the way you do in standard Mac applications.

This package will make your Mac ready for AppEngine development, but it will not help you with customizing Aptana. You need to have a copy of all libraries used in SDK on your computer.

For this purpose you need to download the ZIP file listed in the same page (for Linux/Other platforms) and unzip it in a folder in your Mac (e.g. Documents).

Now download and install Aptana and install PyDev, a plugin for Python development in Aptana:

  1. Open Aptana and in My Aptana page (opens when you run the application), switch to Plugins tab.
  2. Find the entry for Aptana PyDev and click Get it.
  3. Go through the installation wizard and restart Aptana at the end, as instructed.

Now you need to configure the environment for AppEngine. Let’s create a new project first.

  1. Open Aptana and create a new project using File > New > Project.
  2. In the project wizard select Pydev > Pydev Project and click Next to continue.
  3. Type in a name for the project and choose 2.5 for Grammer version. This is because AppEngine is  currently supporting Python 2.5.2.
  4. If the Interpreter is empty click the link below to configure an interpreter. Use Autodetect for Aptana to list the available Python installation and proceed.
  5. Click Finish to create and open the empty project.

It is now time for the configuration.

  1. With the project open, open Project > Properties and navigate to PyDev – PYTHNPATH.
  2. Click Add source folder for External Source Folders and browse for the folders you see in figure 1. You can add more libraries if you needed.
  3. Click OK to proceed.

Adding AppEngine library sources
Figure 1

If populating libraries were successful you can see the code completion works just fine.

Code completion in action
Figure 2

Configuring the debugger

Finally you need to configure the debugger, so you can run your projects from within Aptana.

  1. Click Run > Run to open the Run configuration window.
  2. Select Python Run on the sidebar and click New launch configuration (the first button above the sidebar).
  3. Enter a name for the configuration (e.g. AppEngine) and Browse for the project name.
  4. Enter the full path for dev_appserver.py as you see in figure 3.

    Changing the run configuration
    Figure 3

  5. Switch to Arguments tab and enter ${project_loc}/src in the arguments box. You can add more arguments for dev_appserver.py.

    Changing the run arguments
    Figure 4

    Note: If you don’t use the default src folder (that PyDev creates for new projects), you need to omit it in the argument, so it becomes ${project_loc}

  6. Click Apply and then Run the application. You should see the application server run log in the Console window.

Running the appserver from within Aptana
Figure 5

Congratulations. You can now enjoy the power of Aptana while developing for Google AppEngine.

P.S. Special thanks to Joscha Feth because I benefited greatly from his article.


9 Comments

  • Fabio Zadrozny |

    Actually, you should be able to debug Google App Engine from Pydev. I don’t have the details right now… I’ll try to give some details on that at http://pydev.blogspot.com/ around this/next week (so, keep an eye on it).

    Also, it should have code-completion for the google app engine libraries… What exactly are you missing there?

  • Ali |

    Thanks for the comment.

    When I installed Aptana (and then PyDev) on Mac, not the code completion nor the debug worked for AppEngine SDK. It made sense to me to do it manually, though.

    So my search ended up in Joscha’s solution and I ported it to Aptana/PyDev.

    Let us know if there are easier ways, so I can update the post.

    Thanks

  • Ali |

    Thanks, I’m glad you liked it.

    I didn’t try the Google plugin, but it seems to be pretty straightforward.
    Aptana works for me better anyways. Good luck with it :-)

  • Paul Swanson |

    You’ll have to excuse me … I was under the mistaken impression the plugin was for Python development; it’s just for Java development … not enough hours left in my life for that undertaking!

    Aptana was definitely much simpler to install than Eclipse. It’s won my vote for now.

  • nicoals |

    Hi,

    you are missing some quotes around the args.
    At least in aptana 3, it wont work without it.

    Nr

  • nicolas |

    also, a version of the appengine is sylinked to
    /usr/local/google_appengine

    once you have the sdk

So, what do you think ?