Jake Groszewski

Blog

Get Ready for Django 6.1: A Practical Guide to Testing the Release Candidate in a Real Project

The Django team has announced Django 6.1 Release Candidate 1 as the final testing phase before the stable release, with the final version planned for August 5. That's a short runway. If you maintain a Django project and want to avoid scrambling through deprecation warnings after the stable release drops, now is the right time to spin up an isolated environment, run your test suite against the RC, and fix what breaks.

This post walks through exactly that: installing the RC, running your tests, and handling the most common issues you're likely to hit.

Why Bother Testing Against a Release Candidate?

Django maintains a rapid but stable release cadence, and part of what makes that cadence work is community testing during the RC phase. When enough developers test pre-release versions against real codebases, regressions get caught before they reach production. That's the deal: Django ships quality releases partly because users report problems during windows like this one.

Beyond community duty, there's a practical self-interest angle. Major Linux distributions like Fedora actively ship Django as a system package and push security and update advisories downstream. Staying current with the framework means you're positioned to receive those patches quickly rather than carrying technical debt until the version gap forces your hand.

The stable release is roughly two weeks out. Testing now is the lowest-risk moment.

Setting Up an Isolated Environment

Don't test the RC against your active development environment. Use a dedicated virtual environment so your main setup stays untouched.

# Create a fresh virtual environment for RC testing
python3 -m venv .venv-django61rc
source .venv-django61rc/bin/activate

# Install Django 6.1 RC1
pip install --pre django==6.1rc1

# Verify the installed version
python -m django --version
# Expected output: 6.1rc1

If you're pinning Django in a requirements.txt or pyproject.toml, you'll want a separate requirements file for testing:

# requirements-rc-test.txt
django==6.1rc1
# paste the rest of your dependencies here

Then install from that file:

pip install -r requirements-rc-test.txt

At this point you have a clean environment running the RC. Pull your project code into it and move on to actually running things.

Running Your Test Suite

If you have a test suite (and if you don't, this is a good prompt to start one), run it now:

python manage.py test --verbosity=2

The --verbosity=2 flag is worth including here specifically. You want to see every test name and any warning output, not just pass/fail counts. Deprecation warnings are your main signal during RC testing.

To make sure Python surfaces deprecation warnings as actual output rather than silently swallowing them, run with the warnings filter enabled:

python -W error::DeprecationWarning manage.py test

This promotes deprecation warnings to errors, which forces them to surface as test failures. That's aggressive, but it's the right approach when you're specifically auditing for upgrade issues.

A Small Sample Project to Sanity-Check Your Setup

If you want a minimal baseline before throwing your full codebase at the RC, here's a trimmed-down project structure that covers the common upgrade friction points:

# myapp/models.py
from django.db import models

class Article(models.Model):
    title = models.CharField(max_length=200)
    body = models.TextField()
    created_at = models.DateTimeField(auto_now_add=True)

    def __str__(self):
        return self.title
# myapp/views.py
from django.shortcuts import render, get_object_or_404
from .models import Article

def article_list(request):
    articles = Article.objects.order_by('-created_at')
    return render(request, 'myapp/article_list.html', {'articles': articles})

def article_detail(request, pk):
    article = get_object_or_404(Article, pk=pk)
    return render(request, 'myapp/article_detail.html', {'article': article})
# myapp/urls.py
from django.urls import path
from . import views

urlpatterns = [
    path('', views.article_list, name='article-list'),
    path('<int:pk>/', views.article_detail, name='article-detail'),
]
# myapp/tests.py
from django.test import TestCase
from django.urls import reverse
from .models import Article

class ArticleViewTests(TestCase):
    def setUp(self):
        Article.objects.create(title='Test Article', body='Some content here.')

    def test_list_view_returns_200(self):
        response = self.client.get(reverse('article-list'))
        self.assertEqual(response.status_code, 200)

    def test_detail_view_returns_200(self):
        article = Article.objects.first()
        response = self.client.get(reverse('article-detail', args=[article.pk]))
        self.assertEqual(response.status_code, 200)

    def test_detail_view_404_on_missing(self):
        response = self.client.get(reverse('article-detail', args=[9999]))
        self.assertEqual(response.status_code, 404)

This gives you a working baseline. If this runs cleanly under 6.1 RC1, you know your environment is configured correctly before you move on to your real application code.

Common Deprecation Warnings and How to Fix Them

The specifics depend on what version you're upgrading from, but a few patterns appear repeatedly across Django major version bumps.

DEFAULT_AUTO_FIELD warnings tend to surface if you haven't explicitly set this in your settings. Add it to silence the warning:

# settings.py
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

URL pattern changes occasionally break older re_path usage that can be replaced with the cleaner path() converter syntax. If you see warnings around URL configuration, audit your urls.py files and replace patterns like:

# Old-style pattern you might still have around
from django.urls import re_path
re_path(r'^articles/(?P<pk>[0-9]+)/$', views.article_detail),

with:

from django.urls import path
path('articles/<int:pk>/', views.article_detail, name='article-detail'),

Middleware and context processor deprecations sometimes appear when third-party packages haven't caught up yet. When you see a warning that traces back into a dependency rather than your own code, check whether an updated version of that package is available. Many maintainers release compatibility updates in the weeks around a Django RC announcement.

Checking Third-Party Dependencies

Your own code is only half the picture. Run this to get a quick read on which installed packages might have compatibility issues:

pip install django-upgrade-check
django-upgrade-check

Alternatively, just run your full test suite and watch for import errors or RemovedInDjango70Warning messages. Those warnings pointing to third-party packages are your signal to check PyPI for newer releases or open issues on the relevant repositories.

You can also query your installed packages directly:

pip list --outdated

This isn't Django-specific, but it catches cases where a package is several versions behind and a newer release already includes Django 6.1 compatibility fixes.

What to Do If You Find a Bug

If something breaks and you've confirmed it's not a change in your code or a third-party package issue, report it. The RC phase exists specifically so the community can surface regressions before the stable release ships. File a ticket at https://code.djangoproject.com with a minimal reproduction case. The Django team is actively monitoring these reports during the RC window.

The August 5 target date gives you time to test, report, and potentially see a fix land before the stable release if the issue is real. That window closes fast once the final release is out.

Before You Upgrade in Production

Once you've confirmed your test suite passes cleanly and you've addressed any deprecation warnings, there are a few final checks worth running before you plan your production upgrade:

  • Verify your deployment tooling (Docker base images, CI configuration, hosting platform) supports Python versions compatible with Django 6.1.
  • Update your pinned Django version in requirements.txt or pyproject.toml to django>=6.1,<6.2 once the stable release drops.
  • Run python manage.py check --deploy in a staging environment after upgrading to catch any deployment-specific configuration issues.

The Django project's emphasis on being a high-level framework that handles much of the complexity of web development means most of that value compounds over time only if you actually stay current. Testing against RC1 right now is the practical way to make August 5 a non-event rather than a scramble.