As a fork of DMOJ, CHTOJ serves as CHTOJ's official online judge and hosts its programming contests.
See it live at oj.thptchuyenhatinh.edu.vn!
Check out its features here.
Refer to the install documentation here. Almost all installation steps remain the same as the docs, but there are several minor differences, including cloning this repo instead of DMOJ's repo.
-
You have to define
DMOJ_PROBLEM_DATA_ROOTinlocal_settings.py, which should be the path to the directory that contains your problems' tests. -
Regarding disabling full-text search, please read this issue for more information.
-
To sync the judge server and the site's cache, change the cache framework (
CACHES) tomemcachedorredisinstead of the default (local-memory caching). -
If you use
python3 manage.py loaddata demo, the home button in the admin dashboard (/admin) links you tolocalhost:8081, there are 2 ways to change that:- You can change that in demo.json
- You can go to the admin page, scroll down to find the
Sitessetting and changelocalhost:8081to your domain.
-
To support
testlib.h, you need to copy testlib.h tog++'s include path in the judge server. To speed up compile time, you can also create a precompiled header fortestlib.h. -
You must add the following to
nginx.conf.location /media { alias <path to media>; }
After configuring dmoj/local_settings.py, initialize the pinned static-assets submodule and prepare the configured STATIC_ROOT before starting Django:
git submodule update --init --recursive
python manage.py prepare_dev_static
python manage.py runserverprepare_dev_static runs both collectstatic and compilejsi18n. Run it again whenever STATIC_ROOT is cleared or static files or JavaScript translations change. Generated output remains outside Git in the configured STATIC_ROOT.
Production deployment tooling should likewise run both collectstatic and compilejsi18n before serving the application. The base template inlines the generated JavaScript catalog, so collecting other static files alone is not sufficient. prepare_dev_static deliberately remains DEBUG-only and is not a production deployment command.
Take a look at our contribution guideline.
If you find any bug, please feel free to contact us via Discord or open an issue.
Pull requests are welcome as well. Before you submit your PR, please check your code with flake8 and format it if needed. There's also prettier if you need to format JS code (in websocket/).
Translation contributions are also welcome.