The Wire · Showcase
DJANGO FIXES MIGRATION CRASH, TIGHTENS COLLECTSTATIC
By RepoJournal · Filed · About Django
Django's sqlmigrate command no longer crashes when renaming models with self-referential foreign keys, while the build system cuts false positives in static file collection.
The migration engine had a critical blind spot: when collecting SQL for operations like sqlmigrate, RenameModel operations weren't recording table renames, so subsequent field alterations tried to introspect tables that didn't exist yet [1]. On MySQL this threw an error; on PostgreSQL it silently dropped self-referential foreign key constraints. That's fixed. Simultaneously, the collectstatic command got smarter about what it ignores [2]. It now treats strings as legitimate content in both CSS and JavaScript, drastically reducing false positives where import statements in code got mangled during collection. Both patches land in the next release. The djangoproject.com site itself picked up security hygiene improvements, adding PyPI token revocation to the release checklist [3] and fixing deprecated HTML attributes in the module index [4]. Release documentation also got hardened with formal security standards [5], signaling tighter controls on how Django ships.
Action items
- → Review the sqlmigrate fix if you have RenameModel operations in pending migrations django/django [plan]
- → Test collectstatic behavior in your next CI run if you have JavaScript imports in assets django/django [monitor]
References
- [1] Fixed #33185 -- Fixed sqlmigrate crash for RenameModel with a self-referential foreign key. django/django
- [2] Fixed #36969, #35371 -- Reduced false positives in strings during collectstatic. ↗ django/django
- [3] [checklists] Added PyPI token revocation to checklist. django/djangoproject.com
- [4] Replaced deprecated name attribute with id in py-modindex.html. django/djangoproject.com
- [5] Doc'd security standards in howto-release-django.txt. django/django
FAQ
- What changed in Django on June 12, 2026?
- Django's sqlmigrate command no longer crashes when renaming models with self-referential foreign keys, while the build system cuts false positives in static file collection.
- What should Django teams do about it?
- Review the sqlmigrate fix if you have RenameModel operations in pending migrations • Test collectstatic behavior in your next CI run if you have JavaScript imports in assets
- Which Django repositories shipped on June 12, 2026?
- django/django, django/djangoproject.com