fle-internal / ka-lite-central

KA Lite central server code (wraps the ka-lite repository and adds features)
https://kalite.learningequality.org/
4 stars 20 forks source link

KA Lite Central Server

This is the code for the KA Lite Central Server: https://kalite.learningequality.org

The repo contains two branches:

What this is

Bootstrapping a dev env

  1. Install Docker

  2. Build assets:

    make assets
  3. Create a virtualenv and install dependencies

    mkvirtualenv centralserver
    workon centralserver
    pip install -r requirements.txt
  4. Go into the centralserver directory and bootstrap it:

    cd centralserver
    python manage.py setup --no-assessment-items
  5. Run the server:

    cd centralserver
    python manage.py runserver 0.0.0.0:8000

Docker workflow

The docker container mounts your current working directory in the container, builds assets and shuts down. All changes are stored directly in your git checkout.

There is no workflow for quickly building assets while editing source files and having a development web server automatically reload. None of that.

If you are changing Docker stuff, remember to run docker image prune once in a while to delete garbage images.

Pointing distributed ka-lite servers to local central server

After cloning the distributed server codebase from https://github.com/learningequality/ka-lite, add the following to its ~/.kalite/settings.py:

CENTRAL_SERVER_HOST   = "127.0.0.1:8000"
SECURESYNC_PROTOCOL   = "http"

This will cause it to point to your locally running instance of the central server for registering and syncing.

Custom local configuration

You may create a centralserver/local_settings.py file to customize your setup.

You don't have to. The default is DEBUG=True and to use a local sqlite db.

Use USE_DEBUG_TOOLBAR = True for the Django debug toolbar.