Installing autojudge

autojudge is a tool developed for automating evaluation for code submission in coding contests and in assigments at college. For your convenience, we have split this usage manual into 3 phases.

Phase 1 : Get autojudge and set up your environment

Phase 1a: Getting autojudge

autojudge is available on GitHub, and you can download a version of your choice from the releases page. We prefer that you use the latest version.

Extract the compressed files and you now have autojudge ready to use.

If you are a fan of master, then clone the repository, either using git or by downloading from GitHub from here.

Phase 1b: Setting up your environment

The evaluation of submissions are conducted on a Docker image that is built while initializing the application. Please install Docker using the instructions provided on their installation page.

If you are very conservative about populating your default environment with random Python packages, create a virtual environment for installing some new packages either using virtualenv or conda-env.

Install the requirements specified in requirements.txt. Don’t forget to activate your environment if you have one.

If you going to deploy autojudge, please install PostgreSQL using the instructions provided on their installation page.

Phase 2 : Run autojudge

Activate your environment.

Create and apply database migrations in Django with the following commands:

python makemigrations
python migrate

There are two ways of using autojudge.


To run autojudge locally:

python runserver

Go to localhost:8000 in your favourite browser. Keep yourself connected to internet for full functionality as certain frontend support such as JavaScript scripts are pulled from the internet.

The program scores the submissions serially in the chronological order of submissions. It can be started anytime after the server has started, but it is preferred that the program be kept running in parallel with the server. Run it using:



The procedure to deploy autojudge is different from running locally. Below are a series of steps that will help you deploy autojudge.

Set the environmental variable AUTOJUDGE_SECRET_KEY to a random string, which should not be exposed to anyone. Think of it to be a private key.

Now modify a few more settings to The first is to setup the database. We suggest using a PostgreSQL database. This modification can be done by adding the below dictionary to Modify the values NAME, USER, PASSWORD, HOST and PORT accordingly.

    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'mydatabase',  # Sample
        'USER': 'mydatabaseuser',  # Sample
        'PASSWORD': 'mypassword',  # Sample
        'HOST': '',  # Sample
        'PORT': '5432',  # Sample

Next we setup the STATIC_ROOT path, the location where you would like the static files to be generated. This has to be set in

To generate the static files, run:

python collectstatic

The static files are generated in the path specified by STATIC_ROOT previously.

Now host the static files on a server and configure the URL in STATIC_URL in If you have hosted the generated static files at, then change the STATIC_URL to (note the trailing slash is required).

You could optionally setup a cache server. Instructions to do this are specified here.

Configure the security settings in (leave it to the default values if you will be hosting on https).

To configure the Apache server using WSGI, follow the instructions here.

And finally, set environment variable DJANGO_SETTINGS_MODULE to autojudge.settings_production as opposed to autojudge.settings which is present by default.