Skip to content

Instantly share code, notes, and snippets.

@sigmadream

sigmadream/dmoj-setup.md

Last active Jun 2, 2020
Embed
What would you like to do?
DMOJ 설치 관련
  • 주의, Ubuntu 20.04 이상에서 작동
$ sudo apt update -y
$ sudo apt upgrade -y
$ sudo apt install -y python-is-python3
$ sudo apt install -y python3-venv python3-pip
$ sudo apt install -y git gcc g++ make libxml2-dev libxslt1-dev zlib1g-dev python3-dev gettext curl wget redis-server

$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
$ sudo apt install -y nodejs
$ sudo npm install -g sass postcss-cli autoprefixer

$ sudo apt install mariadb-server libmysqlclient-dev
$ sudo service mysql start
$ sudo mysql -uroot -p
MariaDB> CREATE DATABASE dmoj DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_general_ci;
MariaDB> GRANT ALL PRIVILEGES ON dmoj.* to 'dmoj'@'localhost' IDENTIFIED BY 'dmoj';
MariaDB> exit

$ git clone https://github.com/DMOJ/online-judge.git
$ cd online-judge
$ git checkout v2.1.0
$ git submodule init
$ git submodule update

$ python -m venv venv
$ . venv/bin/activate
$ pip install wheel
$ pip install -r requirements.txt
$ pip install mysqlclient

$ cd dmoj
$ wget https://raw.githubusercontent.com/DMOJ/docs/master/sample_files/local_settings.py
// 데이터베이스의 <password>를 수정하세요.
$ cd ..

$ python manage.py check
$ ./make_style.sh
$ python manage.py collectstatic
$ python manage.py compilemessages
$ python manage.py compilejsi18n

$ python manage.py migrate
$ python manage.py loaddata navbar
$ python manage.py loaddata language_small
$ python manage.py loaddata demo
$ python manage.py createsuperuser

$ sudo service redis-server start

$ python manage.py runserver 0.0.0.0:8000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment