Installation¶
Installing KUAS API is a simple job. follow the instruction and you can easily install it.
Note
KUAS API is currently using Python 3.
First, obtain Python_3 and virtualenv if you do not already have them. Using a virtual environment will make the installation easier, and will help to avoid clutter in your system-wide libraries. You will also need Git in order to clone the repository.
First, clone the repo from github:
$ git clone https://github.com/johnsounder/ap-api
$ cd ap-api
Once you finish, create a virtual environment somewhere on your disk, then activate it:
$ virtualenv .env --python=python3.4
$ source .env/bin/activate
You can deactivate virtual environment with:
(.env)$ deactive
Now you are using a virtual environment with Python 3. We must change to branch v2 and install requirements module:
(.env)$ git checkout v2
(.env)$ pip install -r requirements.txt
(.env)$ yarout -S redis
After install all requirements module, you will need to fixed the python2/3 version problem about flask-APIABlueprint:
(.env)$ sed -i -- 's/iteritems/items/g' .env/lib/python3.4/site-packages/flask_apiblueprint/apiblueprint.py
Then, the installation is done. You can run KUAS API now with this:
(.env)$ redis-server &
(.env)$ python src/web-server.py
Or like this:
(.env)$ gunicorn -b 0.0.0.0:5001 web-server:app