Navigation Menu

Skip to content

Alaxe/judgeSystem

Repository files navigation

judgeSystem

A python/django based system for testing c/c++ solutions to algoritmic problems

What it does now:

  • Basic Login/register funtionality
  • Task/test editing
  • Testing solutions
  • A simple blog
  • Searching by tags

Required software:

  • A linux distribution (tested on Arch and Ubuntu)
  • Python 3 (tested with 3.5)
  • Python modules: view requirements.txt
  • g++ compiler
  • A database (postgresql recommended)
  • rabbitmq
  • isolate sandbox

How to install:

  1. Clone the repository git clone https://github.com/Alaxe/judgesystem.git

  2. (Optional) install virtualenv (guide)

  3. Setup settings judgeSystem/settings.py

    • EMAIL_<setting_name> - Used for account confirmation, default server is gmail
    • RECAPTCHA_PRIVATE_KEY and RECAPTCHA_PUBLIC_KEY - self explanatory, You can get them from their website
    • SITE_HOST the domain / ip of the server; used for some links
    • ALLOWED_HOSTS
    • SECRET_KEY
    • TIME_ZONE
  4. Setup database

    • install it (guide for postgres)
    • Fill in DATABASE in judgeSystem/settings.py
  5. Other dependencies

    • Python modules sudo pip install -r requirements.txt --upgrade
    • Static files python manage.py collectstatic
    • (optinal) create a super user python manage.py createsuperuser
  6. Database migrations

    • Generate any missing migrations python manage.py createmigrations
    • Create the database schema with python manage.py migrate
  7. Install rabbitmq

    • sudo apt-get install rabbitmq
    • Start the service sudo systemctl start rabbitmq-server and enable it sudo systemctl enable rabbitmq-server (i.e. make it start on boot) Note: This assumes that you have systemd. While that's the case with newer distros, you may have to use an your disto's init system
  8. Install isolate

    • Clone the repository git clone https://github.com/ioi/isolate
    • Install make install (Has to be run from the repository's directory)
  9. (optional) Install a proper web server (you can use the development server, which comes with django, but it's not suitable for production) Here's a guide for nginx with uwsgi, a bit out of date though

    • When configuring uwsgi instead of module use wsgi-file and the full path to judgesystem/judgeSystem/wsgi.py
    • Most distros have systemd services so instead of sudo service ... use sudo systemctl (start|restart|stop|enable) (nginx|uwsgi)
  10. (optional) Install celery as a service (systemd)

  • Add to judge-celery.service the full path to the repository
  • Copy the file to create the service sudo cp judge-celery.service /etc/systemd/system/ and reload the services with sudo systemctl daemon-reload
  • Control it with sudo systemctl (start|stop|restart) judge-celery and make it auto-start with sudo systemctl enable judge-celery

How to run:

  • Web server
    • If you installed a nginx it should be running as a service
    • For the development serverepython manage.py runserver (you can add a url:port pair as a parameter)
  • Celery
    • If you installed the service it should be running
    • Otherwise sudo ./run_celery

About

A python/django based system for testing c/c++ solutions to algoritmic problems

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages