Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


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

ExponWords is a web application for learning words. It helps learn the word pairs fed by the user using the principle that the more we have already practiced a word, the less we need to practice it in the future. You can read more at

ExponWords is used at (which is a free service).


This section describes how to set up an ExponWords server on Debian or Ubuntu Linux using the nginx web server and the sqlite database engine. These steps apply only if you want to run no other web service. If you do want that, then you can adjust these steps accordingly.

Install the prerequisites

$ sudo apt-get install python3 python3-pip python3-dev sqlite3 gettext nginx
$ pip3 install virtualenv
$ export EW_ENV=$HOME/virtualenv/ewenv
$ virtualenv "$EW_ENV"
$ "$EW_ENV/bin/pip" install django==2.1 gunicorn==19.9.0

I used the following versions of these programs:

  • Python: 3.6.7
  • gettext:
  • nginx: 0.8
  • sqlite3: 3.22.0
  • virtualenv: 16.2.0
  • Django: 2.1
  • gunicorn: 19.9.0

Set up ExponWords and run it in debug mode

  1. Create a Django project (this will create a directory called ExponWords with some Python files; the ExponWords directory will contain all ExponWords-related stuff):

     $ source "$EW_ENV/bin/activate"
     $ cd "$HOME"  # The directory that will contain the ExponWords dir
     $ startproject ExponWords
  2. Clone the ExponWords repository as a Django application called ew:

     $ cd ExponWords
     $ git clone git:// ew
     $ ls
     ExponWords  ew
  3. Edit (you will find an example in ew/setup/

    • DEBUG, TEMPLATE_DEBUG: comment these out
    • ALLOWED_HOST: add ['localhost']
    • INSTALLED_APPS: append 'ew'
    • MIDDLEWARE_CLASSES: insert 'django.middleware.locale.LocaleMiddleware' after CommonMiddleware
    • DATABASES: fill it in according to the database you want to use. I used sqlite.
    • LANGUAGES: copy it from the example
    • USE_L10N, USE_TZ: update according to ew/setup/
    • STATIC_URL: update according to ew/setup/
    • LOGGING: add according to ew/setup/
  4. Overwrite with the one in the setup directory:

     $ rm
     $ ln -s /path/to/ew/setup/
  5. Set up the database files. When asked about whether to create a superuser, create them.

     $ cd ..
     $ python migrate
  6. Compile the translation files:

     $ cd ew
     $ compilemessages
     $ cd ..
  7. Copy the debug startup script and change the ports and EW_ENV value in it if you need to:

     $ cp ew/setup/ .
     $ vim
  8. Start the server in debug mode:

     $ ./

    Try it from the browser by opening http://localhost:8002.

    Try the admin page: http://localhost:8002/admin.

    Finally close it: kill with CTRL-C.

Set up the nginx web server and run ExponWords in production mode

  1. Copy the startup script and change the ports and EW_ENV value in it if you need to:

     $ cp ew/setup/ .
     $ vim
  2. Perform the following steps as root:

    Rename the original nginx configuration file:

     # mv /etc/nginx/nginx.conf{,.old}

    Copy the provided config file instead and modify its content to match your paths:

     # cp ew/setup/nginx.conf /etc/nginx/nginx.conf
     # vim /etc/nginx/nginx.conf

    Reload NGINX configuration:

     # /etc/init.d/nginx reload
  3. Start the production server, try it and kill it:

     $ ./

    Try it from the browser by opening http://localhost.

    Try the admin page: http://localhost/admin.

    Finally close it: kill with CTRL-C.

Running ExponWords in production

  1. If you want to run ExponWords in actual production, you should modify

    • Set DEBUG to False.
    • Set TEMPLATE_DEBUG to False.
    • Set ALLOWED_HOST with the domain of your website (e.g. ['']).
    • Delete the EMAIL_BACKEND configuration entry.
    • Set DEFAULT_FROM_EMAIL to your real e-mail address.

Set up email sending

  1. Set up the name of your site:

     $ python shell
     >>> from django.contrib.sites.models import Site
     >>> s = Site.objects.get(pk=1)
     >>> s.domain = ''
     >>> = 'ExponWords'
  2. Set up SMTP server and configure Django to use it. See more information here:

Start ExponWords automatically after boot

In Debian or Ubuntu, ExponWords can be set to start up automatically by performing the following steps as root.

  1. Copy the provided init script to the directory of the init scripts and open it:

     # cp ew/setup/exponwords.d /etc/init.d/exponwords
     # vim /etc/init.d/exponwords
  2. Update the following lines:

    • RUN_AS: Replace with the name of the Unix user running ExponWords.
  3. Try the script:

     # Run as root:
     $ /etc/init.d/exponwords start
     # It doesn't return the prompt. The web site is available.
     # From another console as root:
     $ /etc/init.d/exponwords stop
     # The web site is no longer available.
  4. Run update-rc.d to create symbolic links in the /etc/rc*.d/ directories, which will make operating system call /etc/init.d/exponwords automatically with the start parameter after the system has booted, and with the stop parameter before it shuts down.

     # update-rc.d exponwords defaults

Set up Google Analytics

If you want to use Google Analytics to track the usage statistics of your site, create a file ew/templates/ew/custom_head.html and place the tracking code given by Google in it (with the scripts tags).

Upgrading ExponWords

There is a file in this directory called UPGRADE.txt which describes what actions should be performed when Upgrading ExponWords.


You can read the user documentation at