Public | Automated Build

Last pushed: 8 months ago
Short Description
Full Description


A django project for developing components of the KoBoToolbox, including the new version of KoBoForm

Installation on Ubuntu

  1. Clone the project:

    git clone

  2. Activate a python virtualenv.

    It's suggested that you use virtualenv wrapper, which provides the "mkvirtualenv" and "workon" commands<br>
    However, without that, you can still create a virtualenv e.g. named pykobo
    virtualenv ~/pykobo

  3. If in production, set production environment variables. (See below)

  4. Install python:

    pip install -r requirements.txt

  5. Ensure system packages are installed:

    apt-get install python2.7-dev
    apt-get install libxml2 libxml2-dev libxslt1-dev

  6. Special package installs (require custom repositories):

    apt-get install postgresql-server-dev-9.3
    apt-get install nodejs

  7. Install javascript dependencies:

    npm install<br>
    bower install

  8. Build javascript and stylesheet dependencies

    grunt build

  9. Continue with "launching the server" (optionally skipping any repeated steps)

Launching the server

  1. Ensure the latest code is pulled

    git pull origin master

  2. Activate the virtualenvironment

    example virtualenv named pykobo<br>
    source ~/pykobo/bin/activate

  3. Consider installing any requirements that have not been installed

    pip install -r requirements.txt # this installs python dependencies inside the vitualenv<br>
    npm install<br>
    bower install

  4. Migrate the database

    python syncdb<br>
    python migrate

  5. Run the server on port 8000

    python runserver OR (when actively developing the application) <br>
    python gruntserver This is an alias for running 'grunt' in the background.

Production environment variables

DJANGO_SECRET_KEY=<use a unique django secret key here>

The server should run in development / debug mode by default, but if you want to change it you can run the command

`source scripts/ true` #sets development mode<br>

LOCAL:  source scripts/ true
LOCAL:  source scripts/ false
HEROKU: sh scripts/ --heroku true
HEROKU: sh scripts/ --heroku false
`source scripts/ false` #sets production mode

Grunt commands

grunt (no arguments)

_default task: triggers requirejs:compile_xlform, build_css, and watch for changes_

grunt build

_triggers requirejs:compile_xlform, build_css_

  • Creates js and css dependencies
grunt build_all
  • Used when launching production
  • Runs build and generates modernizr.js file for use when django is not in debug mode.
grunt build_css
  • Runs sass:dist, cssmin:strip_duplicates, cssmin:dist
grunt test
  • Runs build, karma:unit
Docker Pull Command
Source Repository