Skip to content
James edited this page Aug 26, 2015 · 5 revisions

Recommended Software

pyenv

Allows the maintenance of multiple versions of python on a single machine so that system libraries do not have to be overwritten and paths to compatible versions are maintained for a given piece of software. I highly recommend using pyenv to ensure standard distribution system libraries are maintained and no worry access to the appropriate python library is guaranteed.

To install pyenv, follow the instructions provided in their README.

Once pyenv is installed and configured, installation of the Required Software should be handled entirely using pyenv and pip.

Required Software

Note: Before manually installing any of the following libraries please refer to the documentation detailed by Installation

Django

Django is a python driven web framework. With several versions of the framework available, the latest release (at the time of development), version 1.8, was selected due to its improved security layer but version 1.8 demands the latest version of python. The framework is most likely heavier than the current needs to support the site, but it will allow considerable scalability if the site requirements grow. An alternate and much lighter framework that may fully address the current requirements is Flask.

Python

Django 1.8 requires Python version 3.4 which will be in conflict with the Python versions integrated into the current Ubuntu distributions. To maintain your system Python libraries along side version 3.4, refer to Recommened Software. Warning: Unless you really know what you are doing, DO NOT install python using apt-get

mpld3

mpld3 integrates matplotlib with d3js and allows the rendering of sophisticated graphs to a webpage. In addition to the primary requirements listed above, mpld3 requires matplotlib v.1.3+ and jinja2 v.2.7 as documented on the mpld3 install page

pymongo

Reveal itself uses mongoDB as its data service. pymongo provides a driver to support python interface with the Reveal database.

Installation

Installing Requirements Using pyenv

First clone the repository into a local directory. The following instructions will assume that reveal_site has been cloned into your home directory. The repository can be cloned using the following command:

git clone https://github.com/PositronicsLab/reveal_site.git

Install and configure pyenv according to the instructions provided by the README and verify that pyenv is active in your current console instance by issuing the following command:

pyenv global

The console should respond with 'system' if pyenv is configured properly; otherwise, troubleshoot the pyenv installation until the console responds accordingly.

Once pyenv is successfully verified, issue the following command to install python:

pyenv install 3.4.3

Then rebuild the pyenv shim binaries with:

pyenv rehash

Change to the reveal_site directory and instruct the system to use the newly installed version of python when executing in this directory (and all child directories) with:

pyenv local 3.4.3

You may now safely use pip commands from within this directory or from any of its subdirectories to install python packages to the correct version of python. The following instructions assume that commands will be executed from within the reveal_site directory.

Install Django:

pip install Django==1.8

Install matplotlib:

pip install matplotlib

Install mpld3:

pip install mpld3

Install pymongo:

pip install pymongo

Installing Reveal Site

Once you have followed the previous instructions on cloning the repository and installing requirements, you will have to instantiate the site's internal database. In the root of the repository's directory run the following command:

python manage.py migrate

Execution

To start a local web service, run the following command from the reveal_site directory:

python manage.py runserver --nothreading

A django driven webserver open only to the local system will allow viewing content in a browser. Open a browser and access http://127.0.0.1:8000 to view the reveal data.

Your mongo data server must be running locally for the site to load.

In order for the fields on the form to be populated and for the site to generally work, data must be stored in the Reveal database.