1. Gajo Petrović
  2. automatic-grading-ftn


1. Setting up virtualenv.

Get it with either:

a) easy_install
sudo apt-get install python-setuptools
sudo easy_install virtualenv

b) your package manager (e.g.):
sudo pacman -S python2-virtualenv
sudo aptitude install python-virtualenv

Create a virtual environment:
virtualenv --no-site-packages env-automatic-grading-ftn

2.0. Install prerequisites.
sudo pacman -S libyaml

2. Install the required packages.
source env-automatic-grading-ftn/bin/activate
pip install django
pip install djangorestframework
pip install markdown
pip install django-filter
pip install pyyaml
pip install django-bootstrap-toolkit
#not used atm:
#pip install django-oauth2-provider

3. Use the environment.
Run this once for each shell:
source env-automatic-grading-ftn/bin/activate
Execute commands normally.

4. Create the initial db.
python manage.py syncdb

5. Run the server
python manage.py runserver

6. Packages required for tools:
pip install BeautifulSoup4
pip install requests

7. Docker settings
User should be added to the docker group:
# Add the docker group if it doesn't already exist.
sudo groupadd docker

# Add the connected user "${USERNAME}" to the docker group.
# Change the user name to match your preferred user.
# You may have to logout and log back in again for
# this to take effect.
sudo gpasswd -a ${USERNAME} docker

# Restart the docker daemon.
sudo service docker restart

8. Build 'grading', a docker image (run from docker-setup) based on gajop/grading-base
docker build -t grading .

9. Compile i18n (from webservice, in virtualenv)
django-admin.py compilemessages