Add demo data fixtures, fix deploy migrations, register admin models#53
Merged
Conversation
6a025f8 to
b3b259b
Compare
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.
What
Three related housekeeping changes bundled in this branch:
1. Demo data fixtures (
fixtures/demo_data.json)Adds a seed fixture with a demo account and realistic sample data so the live API is testable without manual setup:
demo_pilotuser (login:demo_pilot/demo_pilot)Load with:
python manage.py loaddata fixtures/demo_data.json2. Deploy migrations fix (
railway.json)The build uses the Dockerfile builder, so the
Procfile'srelease:phase was being ignored and migrations never ran on deploy (production DB was left without tables). AddspreDeployCommand: python manage.py migrateso migrations run automatically on every deploy.3. Register models in admin (
checklist/admin.py,logbook/admin.py)Registers the remaining models so they're manageable from the Django admin.
Notes
loaddatais a one-time manual seed (run once against production), not part of the deploy — the automated step only runsmigrate, neverloaddata, to avoid overwriting live data.demo_pilotis a regular user (no staff/superuser), so the demo account is contained.loaddatabypasses modelsave(),Flight.durationstays null (expected). The demo user's profile is created via signal /get_or_createafter load.How to test locally
python manage.py migratepython manage.py loaddata fixtures/demo_data.json/api/docs/, Authorize withdemo_pilot/demo_pilot, and hitGET /api/flights/.