Skip to content

Mr-Phoebe/BOJ-V4

 
 

Repository files navigation

BOJv4

Getting Started

Basic lib

sudo apt-get install libjpeg-turbo8-dev zlib1g-dev python-pip redis-server python-redis

Virtual environment

Make sure you are using a virtual environment of some sort (e.g. virtualenv or pyenv).

pip install virtualenv
mkdir BOJ
cd BOJ
virtualenv --no-site-packages venv

Clone the project

source venv/bin/activate
git clone https://github.com/BUPT-OJ-V4/BOJ-V4.git
cd BOJ-V4
pip install -r requirements.txt 
cp bojv4/scr_settings.py bojv4/secret_settings.py  # 拷贝一份私密配置,否则系统无法运行

Run the project

Make sure you get root permissions.

mkdir -p /var/log/oj
./manage.py migrate
./manage.py loaddata sites

运行临时服务器查看效果

./manage.py runserver 0.0.0.0:8080

姿势汇总

TemplateView实现多个表单的验证
ojuser/views.py
class GroupUpdateView(TemplateView):
  • 权限控制最重要的接口
https://django-guardian.readthedocs.org/en/stable/api/guardian.shortcuts.html
  • 向表单里面添加非fields的值
ojuser/forms.py
class GroupProfileForm(forms.ModelForm):
  • 后台进程管理
    • 包括redis\nsq\django-server\judge\judge-result等
sudo supervisorctl #查看管理进程

About

BUPT online judge V4

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 80.7%
  • CSS 15.8%
  • Python 2.2%
  • HTML 1.1%
  • Other 0.2%