You will need to have the following installed:

  • elasticsearch (version 5 is not yet supported)

  • PostgreSQL (it’s possible it could work on another database that e.g. handles recursive SQL, but this would need work)

  • If you are using Python 2, in order for the SNI-enabled SSL packages to install, you will need to install some header packages as outlined at the Cryptography library install page.

  • For thumbnail generation to work, you will need the JPEG development headers; e.g. this is the libjpeg-dev package on Debian/Ubuntu.

Installing SayIt as a Django app

If you already have a Django project, and wish to use SayIt in it, you’ll need to do the following. This assumes you already know about installing packages in Python with pip and hopefully in a virtualenv.

  1. Add django-sayit (or e.g. -e git+ if you want the bleeding edge) to your requirements.txt file, or install directly with pip:

     pip install django-sayit
  2. Add the following entries to your INSTALLED_APPS list:

  3. Add the following line to your MIDDLEWARE_CLASSES:

  4. If you’re not using it already, you’ll need to set up haystack, with something like:

         'default': {
             'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
             'URL': '',
             'INDEX_NAME': 'myproj',
  5. Run migrate to get the new SayIt models:

     ./ migrate
  6. Add to your project

     url(r'^speeches/', include('speeches.urls', namespace='sayit', app_name='speeches')),

Optional configuration

  • If you want to limit your speech output HTML to the same as the subset of Akoma Ntoso we use for our import script, you’ll want to have the following bleach configuration:

          'a', 'abbr', 'b', 'i', 'u', 'span', 'sub', 'sup', 'br',
          'ol', 'ul', 'li',
          'table', 'caption', 'tr', 'th', 'td',
          '*': [ 'id', 'title' ], # class, style
          'a': [ 'href' ],
          'li': [ 'value' ],
  • You can optionally install django-tastypie to include its features.

Installing the example SayIt Django project

You’ll need to install pip and virtualenv (Debian/Ubuntu packages python-pip and python-virtualenv).

  1. Clone the repository:

     mkdir sayit
     cd sayit
     git clone
  2. Create a postgres database and user:

     sudo -u postgres psql
     postgres=# CREATE USER sayit WITH password 'sayit';
     postgres=# CREATE DATABASE sayit WITH OWNER sayit;
  3. Set up a python virtual environment, and activate it:

     virtualenv --no-site-packages virtualenv-sayit
     source virtualenv-sayit/bin/activate
  4. Install the required python packages:

     cd sayit
     pip install -e .
  5. Alter the settings to match your setup - the default example project looks for a PostgreSQL database with name sayit-example-project and a blank user. You can override settings by editing the existing files:

    vim example_project/settings/

    or by creating a file at example_project/settings/ and putting your local configuration in there. has access to the settings already set up and can change them, for example:

    echo "DATABASES['default']['USER'] = 'postgres'" >>
  6. Set up the database:

     ./ migrate

    This will ask you if you wish to create a Django superuser, which you’ll use to access the admin interface. You can always do it later with ./ createsuperuser, but there’s no harm in doing it now either, just remember the details you choose!

  7. The development server should now run fine:

     ./ runserver
  8. To gather all the static files together in deployment, you’ll use, as normal:

     ./ collectstatic --noinput