Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Updating and patching a server running a web app without down time is an art. And, there's not a ton of stuff out there about django deployment best practices. Here's a few thoughts from a fellow developer:

Python has a decent way to isolate deployed apps using virtualenv. If you google virtualenv django, you should find some interesting reading.

For automated python deployment on unix boxen, fabric seems to be the state of the art. You might also want to take a look at capistrano on thr ruby on rails side. You'll probably find a lot more interesting reading about deployment tips and tricks by reading stuff from ruby/rails land. (Don't flame me) The Rails guys have historically had more problems with speed and scaling rails, so there's a lot more information out there. They've also built some really cool tools to deal with those problems.

Django has some really cool caching features. I was just playing around with caching and load testing http://newsley.com by throwing ghetto localmem caching on top of my main view, I got an order of magnitude more pages served per second. I didn't even try memcached as a backed yet, but I feel a lot better knowing the basics of how to do that if the need arises. Regardless, you'll want to spend a bit of time learning the caching tools anfd reading about memcached if you're interested about scaling django.

A lot of scaling web apps is about scaling a database. It's routinely the slowest part of your web app. You shouls be able to find a lot of reading about that. The highavailability blog is a great resource for that stuff.

Cal henderson (founder of flikr) wrote a great book called "building scalable websites" if I'm not mistaken.



Excellent advice, thank you !


Any time. Django has been improving their test suite recently, and their documentation on testing has been improving a lot in the last couple of months. There's also projects like Twill and Selenium for building automated tests that I like a lot.

Another thought on practicing deployment. If you really want to learn how to deploy to a multi-server environment, I'd move off of webfaction hosting and onto something like EC2. EC2 is great for being able to spin up and then spin down server instances at will. You could set up a DNS round robin pointing at 3 or 4 django servers which in turn point to a separate db server. Write the build scripts to automate set up and take down of all the separate servers. You could also practice setting up database replication on separate EC2 nodes if you wanted to. And, you're only paying a a couple of bucks a day to practice setting up multiple servers.

You might also be interested in puppet: http://reductivelabs.com/trac/puppet/wiki/DocumentationStart




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: