Sync django-migrations with the updated tutorial - #836
Open
realpython-bot wants to merge 1 commit into
Open
realpython-bot wants to merge 1 commit into
realpython-bot wants to merge 1 commit into
Conversation
…Into Django Migrations Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The maintenance update of Digging Deeper Into Django Migrations re-pins the tutorial to Django 6.1 / Python 3.14 and refreshes the
0001_initial.pylisting, so the companion project indjango-migrations/needed to catch up. It was still a Django 2.1 / Python 3.6 project, and on Django 6.1python manage.py makemigrations --checkfailed, wanting a0003_alter_pricehistory_idmigration the article never shows.What changed
requirements.txt(new) — pinned to the article's dependencies:Django==6.1plus its resolved deps (asgiref==3.12.1,sqlparse==0.6.0), matching how the other Django folders in this repo pin.README.md— installation now says Python 3.14 / Django 6.1 and installs fromrequirements.txtinstead ofpip install "Django==2.*"; the formatting note points at Ruff, which is what this repo runs.historical_data/migrations/0001_initial.py— regenerated on Django 6.1:models.BigAutoFieldfor the implicit primary key, matching the listing in the updated article. This is the change that makesmakemigrations --checkclean again.historical_data/migrations/0002_switch_to_decimals.py— regenerated on Django 6.1 (content is unchanged apart from the header and generated formatting).manage.py,settings.py,urls.py,wsgi.py,asgi.py— brought up to the Django 6.1startprojectscaffolding:pathlibBASE_DIR, the removedUSE_L10Nsetting dropped,STATIC_URL = "static/", the newMAILERSblock, and the docs links repointed from the unsupported/en/2.1/docs to/en/6.1/(the same stale-2.1-docs fix the article got).asgi.pywas missing and is listed in the project tree of the primer article this project is shared with. The project's originalSECRET_KEYandINSTALLED_APPSare kept.db.sqlite3is deliberately left as shipped: it is the database behind the article'sdjango_migrationstable, and runningmigrateon it applies the three newauthmigrations exactly as the updated article describes.How this was verified
On a fresh Python 3.14.6 virtualenv installed from the new
requirements.txt(Django 6.1):python manage.py check— no issuespython manage.py makemigrations --check --dry-run— No changes detected (it wanted a new migration before this PR)python manage.py migrateagainst the shippeddb.sqlite3— appliesauth.0010/0011/0012, and a second run prints No migrations to apply., matching the article's opening transcriptpython manage.py migratefrom a deleted database — full run succeeds against the default SQLite backendpython manage.py sqlmigrate historical_data 0001and--backwards— both produce the output the article shows for the backwards case, and the forwardsCREATE TABLEmatches today's Djangopython manage.py test, plus importingbitcoin_tracker.wsgiandbitcoin_tracker.asgiruff==0.14.1:ruff format --check django-migrationsandruff check django-migrationsboth passNothing outside
django-migrations/is touched.