




















Heya,
I’ve deployed a few Django apps on App Platform so this is doable. A couple of things worth knowing up front though.
For deployment, just connect your Git repo and App Platform builds on every push. Run it with Gunicorn, and set your migrate and collectstatic to run as a pre-deploy step so each release migrates automatically. Put your secrets (SECRET_KEY, DB URL, etc.) in the encrypted env vars, not in the repo.
The one thing that trips people up: the App Platform filesystem is ephemeral. Containers get recreated on every deploy, so anything uploaded to local disk disappears. For a procurement app with attachments/documents, you’ll want to store media on Spaces (their S3-compatible object storage) from day one using django-storages + boto3. Don’t skip this — it’s also what makes your eventual migration painless.
On backups: the managed Postgres comes with automatic daily backups + point-in-time recovery for 7 days, included. But those stay inside DO here’s no button to push a copy to your own machine. If you want local copies, just schedule a pg_dump from your machine (or a cron box) against the DB connection string. That’s what I’d do anyway, regardless of provider.
Migrating in-house later is genuinely low-risk because it’s plain Postgres — no lock-in. Stop writes briefly, pg_dump -Fc, pg_restore on your server (match the major version), verify, cut over. If you need near-zero downtime you can use logical replication and do a short final cutover, but for most people the dump/restore is fine. For the files, since Spaces is S3-compatible you just rclone the bucket over to your new storage (or a MinIO instance) and barely change your Django config.
For DR I’d keep it simple: lean on DO’s automatic backups for quick “oops” recovery, add your own scheduled pg_dump to a second location, mirror the Spaces bucket occasionally, and — most importantly actually test a restore now and then. Untested backups have a way of not working when you need them.
Honestly it’s a solid path. The two gotchas to remember are the ephemeral filesystem (→ use Spaces) and that the auto-backups live inside DO (→ add your own dump if you want local copies). Beyond that, because it’s standard Postgres + S3-compatible storage, you’re never really locked in, which is nice if you’re not 100% sure you’ll stay in the cloud.
Good luck with it!
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。