[python-uk] Suggestions / best practices for deployment

Harry Percival harry.percival at gmail.com
Wed Jun 5 09:54:01 CEST 2013

Hi everyone,

thanks for all your suggestions.  I've been beavering away, and I've got a
first draft of the chapter on deployment ready.  I'd love your feedback!

You can find it at

Here's a broad outline of what I decided to go for:

* Ubuntu server (at Digital Ocean, if you must know)
* Nginx as reverse proxy
* Gunicorn as django server, launched via upstart
* Staging and live served as separate virtualhosts
* Not automated, but templates for nginx + upstart config are in repo

* Use git clone / git pull, with git reset --hard
* manage.py collectstatic to update static files, and manage.py syncdb
(south comes later)
* Virtualenv updates via requirements.txt in repo
* automated using fabric

* a hideous hack of the Django LiveServerTestCase to let us run FTs against
the staging site
* a specific FT that checks that the CSS works (cf previous chapter)
* no unit tests for the fabric script (although I have had a good think
about them, may include them in an appendix)

I've tried to find a balance between keeping things simple -- it's a very
small site, and I can bring in more stuff, eg south, later in the book --
and trying to set people off on a reasonably solid course, that won't leave
them with too many pitfalls later.  It's my first draft, and it would
doubtless be improved immensely by your feedback.  Let me have it!

You'll find a couple of notes + todos at the end..

cheers all, and thanks again for your help!


PS here's another link to where you can buy the book if, you know, you get
a sudden urge ;-)  http://www.obeythetestinggoat.com/

On 20 May 2013 21:23, John Lee <jjl at pobox.com> wrote:

> On Mon, 20 May 2013, Andy Robinson wrote:
>  be run in a live web app.  For example, for an online purchase
>> process, you might have a selenium test which steps right through a
>> purchase using a known "only for tests" account or credit card number.
> [...]
>  I don't know what this kind of testing is called though ;-)
> Expensive?-)
> John
> ______________________________**_________________
> python-uk mailing list
> python-uk at python.org
> http://mail.python.org/**mailman/listinfo/python-uk<http://mail.python.org/mailman/listinfo/python-uk>

Harry J.W. Percival
Twitter: @hjwp
Mobile:  +44 (0) 78877 02511
Skype:         harry.percival
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-uk/attachments/20130605/cdc71c3c/attachment.html>

More information about the python-uk mailing list