Monday, January 21, 2013

PyCharm and Google App Engine on Mac OS X

I really like PyCharm. I've started playing with Google's App Engine to evaluate it for hosting a project. I wanted to build the site in Python - ultimately with Django. I've had it setup and working just fine on my Windows 7 dev box at home, but I really like to be able to also work on my laptop at the local C8H10N4O2 establishment.

Naturally, the PyCharm page that walks through an intro to using PyCharm with GAE uses Windows as the setting. There is little about setting up PyCharm to point to GAE for Mac OS X - other than stating that it will automatically detect it. It didn't. Bummer.

After poking around a bit here's what I had to do:

  1. Make sure that symlinks are generated with GAE launcher. On installation it will ask if you wanted this. If you said no then, simply hit the "GoogleAppEngineLauncher" menu and choose "Make Symlinks...". It'll ask you to authenticate.
  2. In PyCharm, Preferences drop down about half way within the project settings to the Google App Engine item. Enable GAE and enter "/usr/local/google_appengine" for the path. The warning message should disappear as soon as you've entered this.
  3. Optionally enter your Google account email/password if you want to publish the application directly to Google. (I didn't since I'm primarily working on the project local when on the laptop.)
That's pretty much it. Now the code autocompletion will work within Python code. Sweet!

As a side note, I've found the GAE to work sufficiently well, though setting it isn't totally straightforward. And, I've found that when I attempt to use the user login stuff - since I've constrained my application to only the user accounts for my domain - always returns a nasty looking exception page.

No comments: