1
Confusing statement about running "migrate" for Django apps
complete
M
Michael Lenaghan
The Django Sample App instructions say:
"Run python manage.py migrate to perform the initial database migration. You will only need to run this the very first time you deploy your app"
That's confusing; wouldn't you have to run migrate every time you change the schema? And is there no way to automate that, or do you have to manually use the console for each deployment with a migration? Adding to that: you need new code to run the migration, but you also have to make sure the new code doesn't serve traffic until the migration is complete...
Given all of that, it isn't clear how you'd
really
use App Platform to deploy a Django app in a CI/CD pipeline.G
Gabriel Marimón
complete
G
Gabriel Marimón
Hi, Michael! Thank you for your feedback! You're correct in that you may need to migrate again after creating the Django Sample App. We recommend automating this process with a pre-deploy Job, which runs before each deployment (https://docs.digitalocean.com/products/app-platform/how-to/manage-jobs/). This method also ensures that the migration happens successfully before serving traffic. If it fails, the old version of the service remains active instead.
We are updating the documentation to clarify this!