Installation

Pre-requisites

  • python>=3.5
  • virtualenv
  • jdk>=1.7

Installation

Since the website scripts require python-weka-wrapper3, python3 must be installed. Installation should be straightforward, but because for some reason, javabridge doesn't install correctly if you haven't got numpy installed already. Thus, to install everything necessary, you must run:

# Set up virtual environment (with python 3.5 or higher)
virtualenv -p python3.5 venv
. venv/bin/activate

# Install packages for the scripts
pip install numpy

# Install the rest of the Flask packages
pip install -r requirements.txt

Running

To run the server, you can either use heroku, or python:

# Heroku
heroku local

# Python
python run.py

Heroku

To use heroku locally, you will need an environment to run heroku in.

cp sample_env .env
vim .env

Remember that the file will be parsed with bash; comments start with #.

If you are a bit low on space, note that every single heroku run would put temporary files in the heroku tmp directory. To remove them (on cloud9), you may do:

rm -rf ~/.local/share/heroku/tmp/*

If you want to automate this, put this as a cron job.

Python

To run the server with python, you will need to configure your config.py file. Note that, since saving api keys onto file is pretty unsafe, you are encouraged to use environmental variables, and refer to them with os.environ.get function. A config file for testing is provided, in order for you to copy it. Currently, the project is set up such that it tries to find the config.py file first, and only when it fails will it try to find test_config.py. In other words, config.py takes priority over test_config.py.

# Copy and edit config file
cp test_config.py config.py
vim config.py

Of course, you are fully able to run the site without custom configuration, but you are unable to run the database part of the website, namely firebase.

Environment

In order to get the same functionality as with the heroku method (shown above), you must source your environment file as such.

. .env

results matching ""

    No results matching ""