Stonehenge StockTrader, Python Installation Guide


WSO2 StockTrader is an online stock trading sample application with functionality equivalent to the Microsoft .NET Stock Trader sample benchmark application and IBM WebSphere's Trade 6.1 sample application. WSO2 StockTrader is powered by WSO2 WSF/PHP , WSO2 WSF/Ruby, WSO2 WSF/Perl, WSO2 WSF/Python, WSO2 WSF/Spring and WSO2 WSAS and implements the application in PHP, Ruby, Perl, Python, Spring and Java. It serves to illustrate interoperability between .NET, PHP, Ruby, Perl, Python, Spring and Java in deploying high-performance, scalable service oriented applications.

Note: This version of Python Stock Trader can only be installed in Linux.

Prerequisite

  1. Python

    Download and install Python 2.5 or more. If you are in debian based Linux distro you can use the command "sudo apt-get intall python python-dev" to install python. When you install Python from binary package,remember to install development files as well. 
  2. Django 0.96 or newer

    You can download django source and binary releases from here or if you are in debian based Linux distribution use the command "sudo apt-get install python-django" to install Django.
  3. WSO2 WSF/Python

    Install WSO2 WSF/Python. You can download it from here. Version should be 1.0.0 alpha or more. Please follow the README.INSTALL file to install.
  4. .NET Stock Trader 2.0

    You can download it from here.

Installing Python Stock Trader

Download Python Stock Trader from here and unzip it.
  1. Installing Trader Client
    Go inside trader_client directory. Edit request_processor.py and change the LOG_DIR to point to the location of the log file, LOG_LEVEL to the log level that you prefer, WSFC_HOME to point to WSFC installation directory. Edit urls.py and change the 'document_root' of the line (r'^site_media/(?P.*)$', 'django.views.static.serve', {'document_root': '/home/milinda/wso2/stock_trader/media'}) to point to directory where stock_trader/media will reside.  To run the server, execute 'python manage.py runserver YOUR_IP:PORT' command insde the trader_client directory.

Endpoint Addresses

These are the default endpoint addresses
  1. Trader Client
    http://localhost:8000/index