UPDATE: For setting up PyAMF I recommend using this article written over on PyAMF. This original post was written before a patch was created. And there instructions will be more up to date and maintained.
The previous article on this topic can be found here.
I’m also shamelessy pulling from this article. It almost got me there, but there was one thing noted below that I needed to do.
1. Download pyamf.
2. Now unzip the pyamf into a directory ( i went with c:/pyamf ) and browse to it from the command prompt. When you get to the source folder run “ez_setup.py”.
3. Now complete the following steps ( original reference can be found here )
- Download and unpack pyAMF-0.2
- Download fpconst and put it in pyAMF-0.2/pyamf
- Delete the file pyAMF-0.2/pyamf/adapters/__init__.py
- Comment out the line register_adapters(); at the end of pyAMF-0.2/pyamf/__init__.py
(I did these steps and found I still needed to comment out line 26 in the pyAMF-0.2/pyamf/__init__.py that looks like: from pyamf.adapters import register_adapters )
4. After that is completed, go back to your command prompt and run “setup.py install”
5. Afterwards in the directory where you downloaded pyamf you should have a directory that has a dist directory under that. Add the .egg in the dist directory to your System – PYTHONPATH. in windows > prefs > PyDev > Interepretor just like we did for the google.zip file above. ( This will bring in code completion support )
6. From the command prompt start your server /appengine/dev_appserver.py {app name}
7. Browse to http://localhost:8080/
if everything’s set up and running properly you’ll see something like
400 Bad Request
To access this PyAMF gateway you must use POST requests (GET received)
8. Finally, create a flex app. Below is the code I used. You should be able to drop it in your flex app file. If everything works you can use the appcfg.py commands to upload your application and point your endpoint to your new application url.

This is by no means complete and I hope to get more examples up and running soon. If you have any questions feel free to comment or email me. I’ll be posting on how to debug python apps from eclipse when making calls from flex and also some other topics that have been floating around. Like Google Authentication.
Recent Comments