Search code examples
djangopostgresqlnginxgunicornlinode

How to setup a VPS with Django, Nginx, Gunicorn, Postgres and then properly deploy a Django application to it?


Perhaps there is a definitive tutorial or blog describing what I'm looking for, but I haven't seen it. And being new to Django, I'm really looking for a proper way to both set up a VPS and deploy the project to it ... the latter in a repeatable/sensible way as the project evolves.

Here is what my project looks like:

  1. Using Django 1.6.2 + Postgres
  2. Project structure is essentially what is described here
  3. Static assets delivered locally in development need to be uploaded/delivered from S3 in production
  4. My VPS is a basic Linode running Ubuntu 13.10

Solution

  • I would say Test-Driven Web Development with Python is a good one. It's mostly focused on TDD, but it's really good at covering the basics of Django as well. Chapter 8 talks about deployment and is pretty thorough.

    EDIT:

    Saw that that book doesn't use S3 for static files, so I'd recommend this blog post for dealing with that.