3 ms·
Big Django user and fan here! Ask HN: I plan on developing and deploying a bunch of Django apps in the coming months as I’m doing a 3 month stint at https://re
by gregsadetsky 3y ago
Big Django user and fan here!
Ask HN: I plan on developing and deploying a bunch of Django apps in the coming months as I’m doing a 3 month stint at https://recurse.com https://recurse.com
GitHub Pages is great for purely static content - but what is the preferred/""best""/cheapest option for django/postgres hosting?
I know there’s tons of options - I used to be a Heroku fan until recently. Now am on Render (where things get expensive)
Is Pulumi/Terraform/IaC on AWS the way? I want git-deploys, not have to write .sh scripts to restart nginx and pip dependencies that auto un/install if possible.
I also thought of deploying one mega django project and having everything be a django app under that - it doesn’t feel sustainable/clean but maybe it’s ok for a bunch of small projects?
Thanks!
- bredren 3y agoI use GitHub actions to automate test / build / deploy of django / Postgres / nginx docker orchestrations. I prefer digital ocean for VPS and have found you can get pretty far on the smaller droplets. I’ll typically have two environments, one getting auto deploys from anything on a feature branch, and production which gets deployed when there are changes to main. For my setup, I initially learned using blog entries from the folks who blog at: https://testdriven.io/blog/ https://testdriven.io/blog/ I blended multiple entries to achieve just the setup I wanted. I haven’t gone up to terraform though, finding it sufficient to use a pre built image of ubuntu / docker at the initialization. My oldest projects still use .sh to handle deploys but I’d never go back to that stuff.
- theptip 3y agoIf you're not deploying at large scale, I'd go with something elastic in the same vein as Render (I haven't used that one though). Heroku used to be my go-to recommendation here of course. Fly.io gets a lot of love as a Heroku replacement and they have a generous free tier (though they have had some uptime troubles recently). Alternatively GCP and AWS both have elastic compute options that should work as well. (App Engine and Beanstalk? respectively.) Running a VM is going to be annoying (way more ops toil) and cost you more than you need, if you're making on the order of requests-per-hour instead of requests-per-minute. But if a VM is cheaper than your best elastic option you can make it work. I would not recommend sharing apps within a project as migrations can be annoying and you'll get downtime on every app whenever you deploy or break any of them. But you could have one VM serving up lots of projects, and give one port per project, then wire up a load balancer & DNS name for each project/port. It's possible to do git-deploys with a VM but it's a little work to wire up. You'd set it up with GitLab, and you can wire up a simple deploy script that effectively does a `docker stop && docker run` to launch your new app container.
- danjac 3y agoI use Dokku for side projects, where I don't expect high traffic, I'm the sole developer and I don't want any unexpected invoices I might get from a cloud provider. You can run it on top of a single cheap VM, for example Digital Ocean or Hetzner, for a few dollars/euros a month. It is compatible with a lot of Heroku buildpacks e.g. PostgreSQL and Redis, has a similar CLI, and includes plugins for things like LetsEncrypt that can be installed with a couple commands. As with Heroku and other PAAS you can deploy with a simple git push. It's absolutely fine for the MVP stage of a more serious project, but it's not really meant for scaling out beyond a single server. I mean sure, it's possible, but there are better tools for the job, and at that point you should have a bigger budget/team.