Skip to content

Latest commit

 

History

History
88 lines (61 loc) · 2.42 KB

README.MD

File metadata and controls

88 lines (61 loc) · 2.42 KB

RSSM

This repository is deployed at orfeus-eu.org/rrsm.

Quickstart

  1. Create the .env configuration file from /src/rrsm/.env.sample and adjust its values.

    cp src/rrsm/.env.sample src/rrsm/.env
    • SECRET*KEY should be a 50-characters long string of random characters from the following set: abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&\*(-*=+)
    • Only SECRET_KEY, DEBUG and ALLOWED_HOSTS settigns are meaningful. Rest of them can be left unchanged, they are here just to satisfy the Django Framework
    • CACHE_BACKEND can be set to:
      • django.core.cache.backends.memcached.MemcachedCache with location 127.0.0.1:11211 (default for python-memcached)
      • django.core.cache.backends.filebased.FileBasedCache with location e.g. /data/rrsm_cache/
      • django.core.cache.backends.db.DatabaseCache with location e.g. rrsm_cache_table
      • django.core.cache.backends.dummy.DummyCache can be used during development
    • CACHE_TIME_SHORT, CACHE_TIME_MEDIUM and CACHE_TIME_LONG are timers (in seconds) used for cache validation assigned to pages depending on how often their content changes
    • RRSM_URL_BASE allows adding a URL prefix to all RRSM URLs
  2. Create the virtual environment:

    python3 -m venv env
  3. Activate the virtual environment:

    source env/bin/activate
  4. Let's upgrade pip and install the dependencies:

    pip install --upgrade pip
    pip install -r src/rrsm/requirements.txt
  5. Run the test server:

    python3 src/rrsm/manage.py runserver 0.0.0.0:8000

Docker

  1. Make sure ports are set up correctly

    • /src/docker-compose.yml
    • /src/nginx/sites-enabled/django
  2. Build and run the images:

    cd src/
    docker-compose -p 'rrsm' up -d
  3. Connecting to a running container can be done using:

    docker exec -it <CONTAINER ID> sh

Tests

Tests can be executed using following command:

python3 src/rrsm/manage.py test rrsmi

Logs

Tail can be used to follow the app logs:

tail -f src/rrsm/logs/rrsm.log

Remarks

  • The WebService response times in some cases can get long resulting in 504 Gateway Timeout. This can be prevented by modifying the /etc/ninx/nginx.conf on the Nginx container and adding following lines to the basic config:

    proxy_read_timeout 300;