Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


This procedure is based on the following tutorial:

  1. Go to your projects folder (e.g. ~/projects). Create and go to a virtual environment:
sudo apt-get install gettext git python2.7-dev python-virtualenv
virtualenv -p `which python2` skoljka
cd skoljka
echo -e "export PYTHONPATH=\$PWD:\$PWD/skoljka:\$PYTHONPATH\nexport PROD=true\n\nsource bin/activate" > profile
source profile
  1. Clone skoljka and run the installation script:
git clone
cd skoljka
  1. Create an empty UTF8 database (use your username):
mysql -e "CREATE DATABASE skoljka CHARACTER SET utf8 COLLATE utf8_general_ci;" -u username -p
  1. Fill out settings/, at least the fields marked as REQUIRED.

  2. Initialize database and build:

python2 syncdb --noinput
python2 loaddata folders userprofiles

You can now use Django test server by running python2 runserver. The database is pre-filled with superuser arhiva whose password is a. Note that by default, DEBUG is False, so static files won't be loaded correctly.

Configuring gunicorn

The following three sections are used only for running in the release mode.

You should now be in ~/projects/skoljka/skoljka/.

  1. Run cd .. to move to ~/projects/skoljka/.

  2. Create file (fill out user and group variables)

set -e

PORT=8079       # Internal port for non-static files

# user/group to run as

source profile

exec gunicorn skoljka.wsgi:application -w $NUM_WORKERS \
  --user=$USER --group=$GROUP --log-level=debug \
  --log-file=$LOGFILE -b localhost:$PORT
  1. Set up gunicorn.
chmod +x
mkdir -p logs
pip install gunicorn

Configuring supervisor

  1. Run the following commands:
sudo apt-get install supervisor
touch logs/gunicorn_supervisor.log
  1. Create file /etc/supervisor/conf.d/skoljka.conf (use sudo, and change these paths)
directory = /home/username/projects/skoljka/
command = /home/username/projects/skoljka/
user = username
stdout_logfile = /home/username/projects/skoljka/logs/gunicorn_supervisor.log
stderr_logfile = /home/username/projects/skoljka/logs/gunicorn_supervisor.log
  1. Run skoljka Django webserver:
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl restart skoljka

Configuring nginx

  1. Install and start nginx:
sudo apt-get install nginx
sudo service nginx start
  1. Create /etc/nginx/sites-available/skoljka and the symlink /etc/nginx/sites-enabled/skoljka to the first file. Use e.g. 8080 as the main port and remember to redirect / to the port 8079. Look at the tutorial for the details.

  2. Restart nginx

sudo service nginx restart
You can’t perform that action at this time.