Souktel Django project for Teachers Without Borders
JavaScript Python Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


-- restructuredtext --


Development Environment Setup

Clone project and bootstrap virtual environment:

~$ git clone
~$ cd souktel-alert/souktel_alert/
~/souktel-alert/souktel_alert$ mkvirtualenv --distribute souktel
(souktel)~/souktel-alert/souktel_alert$ ./

Create file, syncdb, and runserver:

(souktel)~/souktel-alert/souktel_alert$ cp
(souktel)~/souktel-alert/souktel_alert$ ./ syncdb
(souktel)~/souktel-alert/souktel_alert$ ./ runserver

Visit http://localhost:8000/ in your browser.

Test Suite

To run the project test suite, rename to and use the following command:

(souktel)~/souktel-alert/souktel_alert$ ./ test --settings=souktel_alert.local_test_settings decisiontree group_messaging require_registration goals group_messaging


Deployment uses fabric. To see a list of the available fab commands, run fab --list:

Available commands:

    bootstrap            bootstrap environment on remote machine
    clone                clone github repository on remote machine
    create_virtualenv    create virtual environment on remote host
    production           run commands on the remote production environment
    pull                 pull latest code to remote environment
    restart              restart apache and route
    staging              run commands on the remote staging environment
    update               pull and restart apache and route
    update_requirements  update remote Python environment

Production Environment Setup

To bootstrap a remote environment, modify the fabfile to include the appropriate configuration for your server. The "staging" environment can be used as an example for deployment setup.


Once deployed, create a file on the server that includes all account credentials. For example:

from souktel_alert.settings_staging import *

DATABASES['default']['PASSWORD'] = '******'

    'user': '******',
    'password': '******',
    'api_id': '******',
    'callback': 3,


The RapidSMS route process can be initiated using a script similar to services/ In order to use start the router as a service, create a symbolic link to the bash script in /etc/init.d:

/etc/init.d# ls -l | grep route
lrwxrwxrwx 1 root root    59 2010-08-11 20:56 staging-route -> /home/souktel2010/staging/souktel_alert/services/

Now the route process can be managed via the service command (see the restat fab command as an example):

$ service staging-route restart


Tags input (borrowed from django-taggit) is parsed as follows:

  • If the input doesn't contain any commas or double quotes, it is simply treated as a space-delimited list of tag names.
  • If the input does contain either of these characters:
    • Groups of characters which appear between double quotes take precedence as multi-word tags (so double quoted tag names may contain commas). An unclosed double quote will be ignored.
    • Otherwise, if there are any unquoted commas in the input, it will be treated as comma-delimited. If not, it will be treated as space-delimited.


Tag input string Resulting tags Notes
apple ball cat ["apple", "ball", "cat"] No commas, so space delimited
apple, ball cat ["apple", "ball cat"] Comma present, so comma delimited
"apple, ball" cat dog ["apple, ball", "cat", "dog"] All commas are quoted, so space delimited
"apple, ball", cat dog ["apple, ball", "cat dog"] Contains an unquoted comma, so comma delimited
apple "ball cat" dog ["apple", "ball cat", "dog"] No commas, so space delimited
"apple" "ball dog ["apple", "ball", "dog"] Unclosed double quote is ignored