Skip to content

lutece-awesome/lutece-backend

Repository files navigation

Lutece-Online-Judge

Python Django Build Status Coverage Status

Simplicity online judge

Installation

  • Install requirements
    pip3 install -r requirements/requirements.txt
  • Create configurion file
    cp Lutece/config.py.template Lutece/config.py
  • Install rabbitmq-server

Debian:

    sudo apt-get update
    sudo apt-get install rabbitmq-server
    sudo systemctl enable rabbitmq-server
    sudo systemctl start rabbitmq-server

Arch:

    sudo pacman -S rabbitmq
    sudo systemctl enable rabbitmq
    sudo systemctl start rabbitmq
  • Set task user
    # You need to set Judger AUTH_KEY
    $ sudo rabbitmqctl add_user task_user AUTH_KEY
    $ sudo rabbitmqctl set_user_tags task_user normal
    $ sudo rabbitmqctl add_vhost judger_host
    $ sudo rabbitmqctl set_permissions -p judger_host task_user ".*" ".*" ".*"
  • Install redis for websocket backend

Debian:

    $ sudo apt-get update
    $ sudo apt-get install redis-server
    $ sudo systemctl enable redis-server
    $ sudo systemctl start redis-server

Arch:

    $ sudo pacman -S redis
    $ sudo systemctl enable redis
    $ sudo systemctl start redis

Set running mode

open the .bash_profile file and append the following:

    # Lutece settings, can be 'dev' or 'prod' or 'travis', default is dev
    export lutece_runtime_mode=dev

Then source the terminal to make the change work:

    $ source ~/.bash_profile

Create data folder

    mkdir ~/lutece_data