Skip to content
Wessel Stoop edited this page Aug 4, 2022 · 24 revisions

This is the developer guide for the Dutch fork of Signbank. It was forked from the original version for Australian sign language, developed by Steve Cassidy on Bitbucket. Because other sign language researchers might be interested in making their own fork, either based on our version or on some other, we've created this overview of things that might be handy to know for new Signbank developers. We will assume that you are using an up-to-date fork of the Dutch version, but a lot of stuff here will carry over to other versions.

Getting started

With Django

If you know Python, but are new to Django, we highly encourage you to go through the Django tutorial https://docs.djangoproject.com/en/1.8/intro/tutorial01/ . It's really well written, you'll love it.

With Signbank

Signbank differs in a few ways from typical Django projects:

  • There is no manage.py file in the bin folder. Instead, we use develop.py.
  • Most of the important work is being done in the dictionary folder. This is where all signs and sign operations are defined.
  • For the layout, Bootstrap is used.
  • Various field choices (https://docs.djangoproject.com/en/1.8/ref/models/fields/#django.db.models.Field.choices) are not static, but dynamically read from a Django database, and editable in the Django admin. See https://github.com/Woseseltops/signbank/wiki/How-to-add-new-field-choices-to-Signbank .
  • We have one basic settings file, and then in the folder settings/server_specific a number of files with settings for specific installations. All of these settings files import from 'default.py' and then override the settings they need to be different. When run, Signbank looks for 'settings/server_specific/server_specific.py', so you either need to rename your own settings file this, or have a symlink with this name.

Locales

Signbank uses the regular Django locale system. A few remarks:

  • If logged in, the user preference is saved in the user profile. For example, if a user picks Dutch while logged in, and then logs in on another machine that is using English, Signbank will automatically switch to Dutch. However, these user profiles sometimes only seem to work after they've been added manually in the Django admin at least once.
  • Django does not seem to actually change the language when running Signbank locally with runserver.

Also see https://github.com/Woseseltops/signbank/wiki/How-to-translate-texts-for-Signbank .

Serving media files

As recommended, Django is not used for serving media files. However, this turned out to be problematic when it comes to serving videos and images, as they should only be accessible when the user is logged in... and to know whether a user has access we need Django. We solved this with a solution with X-sendfile inspired by this Stack Overflow post: http://stackoverflow.com/questions/1156246/having-django-serve-downloadable-files#answer-1158750 . When using Apache to serve, this requires the following installation:

https://raw.githubusercontent.com/nmaier/mod_xsendfile/master/mod_xsendfile.c
apxs -cia mod_xsendfile.c

This is a recent version of X-sendfile; a (possibly more) stable variant can be found at https://tn123.org/mod_xsendfile/mod_xsendfile.c. And the following Apache configuration

XSendFile on
XSendFilePath <INSERT WRITABLE_FOLDER_LOCATION HERE>

At the Django side, we use the so-called 'protected_media' view which can found under the dictionary views.

HTTPS and Java 1.6

If you are using software that is bound to Java 1.6 (or lower) and that connects to Signbank (e.g. Elan on Mac OSX, https://tla.mpi.nl/tools/tla-tools/elan/) you run into problems concerning the certificate of the HTTPS connection (using SSL/TLS).

So far attempts to solve this on the client side have been to no avail. Therefore a workaround is carried out for NGT Signbank. This involves installing a smaller prime key in the Signbank HTTPS certificate. This is described on http://httpd.apache.org/docs/current/ssl/ssl_faq.html#javadh. When using Apache, it comes down to the following:

  1. running the command openssl dhparam 1024
  2. and adding the part of the output of this command between and including the lines "BEGIN DH PARAMETERS" and "END DH PARAMETERS" to the end of the first certificate file that the Apache conf file for Signbank refers to.