Interactive Python Shell Example

This page describes how to setup the interactive, stateful Flex shell that runs Python code on the server using Flex and Django.
We recommend you don't run this example on a production server because it exposes huge security risks. This example is for 'educational purposes' ;)

A live demo can be found on the PyAMF Google App Engine example page.

Download

Grab the example from SVN with:

svn co http://svn.pyamf.org/examples/trunk/shell shell-example
cd shell-example/python

Alternatively, if you just want to have a look, you can browse the example online.

Note: make sure you have Django >= 0.96 installed.

Database

This example uses sqlite to provide session support. First initialize the database by running:

python manage.py syncdb

Should output the following:

Creating table django_content_type
Creating table django_session

Gateway

The remoting gateway for the Flash/AMF client is available on http://localhost:8000/gateway/shell/ when you launch
the development server:

python manage.py runserver

You should see something like:

Validating models...
0 errors found

Django version 0.97-pre-SVN-7510, using settings 'python.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

Client

You can simply open the SWF file and it will connect to http://localhost:8000.


Shell example screenshot

Attachments