Skip to content

Django 4 Upgrades (version < 1.23.0)

After upgrading from Codabench <1.23.0, you will need to perform manual interventions.

Django

The Django version upgrade requires all the containers to be rebuilt without cache. In the standard upgrade commands, use docker compose build --no-cache instead of docker compose build.

If migrate asks you to do a makemigration instead, you will have to run the following command:

Bash
docker compose exec django python manage.py makemigrations --merge
You might need to modify /app/src/apps/datasets/migrations/0014_merge_20251212_0942.py to remove the datagroup changes
Python
# Generated by Django 4.2.23 on 2025-09-08 12:32

from django.db import migrations, models
import utils.data
import utils.storage

class Migration(migrations.Migration):

        dependencies = [
            ("datasets", "0010_auto_20250218_1100"),
        ]

        operations = [
            migrations.AlterField(
                model_name="data",
                name="data_file",
                field=models.FileField(
                    blank=True,
                    null=True,
                    storage=utils.storage.PrivateStorageClass(),
                    upload_to=utils.data.PathWrapper("dataset"),
                ),
            ),
            migrations.AlterField(
                model_name="data",
                name="id",
                field=models.BigAutoField(
                    auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                ),
            ),
        ]
Notice that there are only two migrations in this file instead of 3. Simply delete the last one (it tries to change datagroups even after datagroups was deleted, which is why it fails)