Skip to content
This repository has been archived by the owner on Nov 25, 2017. It is now read-only.

Commit

Permalink
Updated the README with new info.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobian committed Mar 9, 2011
1 parent d2f6cc0 commit 3e24115
Showing 1 changed file with 45 additions and 68 deletions.
113 changes: 45 additions & 68 deletions README.rst
@@ -1,77 +1,50 @@
Django Deployment Workshop
==========================

This is code and configuration for my Django Deployment Workshop at PyCon
2010, OSCON 2010, and beyond.
This is code and configuration for my Django Deployment Workshop.

Here you'll find example config used to set up an example deployment environment
for a Python WSGI stack, including:
Here you'll find example config used to set up an example deployment
environment for a Python WSGI stack, including:

* A Django site deployed with Fabric_ and Buildout_
* Apache/mod_wsgi_ application servers
* Nginx_ load balancers and media servers
* Memcached_
* PostgreSQL_ with `pg_standby`_
* A Django site deployed with Pip_, Virtualenv_, and Fabric_.
* Apache/mod_wsgi_ and Gunicorn_ application servers.
* Nginx_ load balancers and media servers.
* Memcached_.
* PostgreSQL_ with `pgpool`_

.. _pip: http://pip.rtfd.org/
.. _virtualenv: http://virtualenv.rtfd.org/
.. _fabric: http://fabfile.org/
.. _buildout: http://buildout.org/
.. _mod_wsgi: http://modwsgi.org/
.. _nginx: http://wiki.nginx.org/
.. _memcached: http://memcached.org/
.. _postgresql: http://postgresql.org/
.. _pg_standby: http://www.postgresql.org/docs/current/static/pgstandby.html
.. _pgpool: http://pgpool.projects.postgresql.org/
.. _gunicorn: http://gunicorn.org/

I've made comments and notes where possible, but it's entirely possible that
this won't make a whole lot of sense without actually taking the class. But this
is all BSD-licensed, so please feel free to use it as a starting point for you
own deployments.
this won't make a whole lot of sense without actually taking the class. But
this is all BSD-licensed, so please feel free to use it as a starting point
for you own deployments.

The Django site used for the examples is Derek Willis' Fumblerooski_. Many
thanks to Derek for letting me (ab)use his code!
The Django site used for the examples is Kevin Fricovsky's Mingus_, a blog
application built on a bunch existing reusable apps.

.. _fumblerooski: http://github.com/dwillis/fumblerooski
.. _mingus: https://github.com/montylounge/django-mingus

Getting the app running
=======================

1. Grab the dump file. This file isn't for public distribution, so it's not
linked here. If you're in one of my classes you'll get the link in an email.
See Mingus's INSTALL_ doc for the basics of getting Mingus running. If you're
on a VM or remote server remember that you'll have to ``runserver 0.0.0.0:8000`` to get Django listening on public IP interfaces.

2. Make sure you have PostgreSQL installed or have access to a database. For
easiest use, you'll want a db named ``fumblerooski``, owned by a user of the
same name, and you'll want to have configured PostgreSQL to allow
non-authenticated access. (Otherwise, you'll need to edit
``fski/settings.py`` with the appropriate credentials.)
.. _install: https://github.com/montylounge/django-mingus/blob/master/docs/INSTALL.textile

3. Restore the data into the database::
After than, start deploying. My script for the install is in ``notes``; be sure to follow along with the most recent one (PyCon 2011 as of this writing).
The other scripts are there for posterity.

zcat fumblerooski-dump.sql.gz | psql fumblerooski
You'll probably get a bunch of warnings and errors, but it should complete
successfully anyway.

4. Run the Buildout::

python bootstrap.py
./bin/buildout
5. You can verify that you've got the basics of everything working okay by
running the dev. server::

./bin/django runserver
If you're running this on a VM and want to be able to access the site remotely,
make sure to make the dev. server listen publicly::
./bin/django runserver 0.0.0.0:8000

(You could also use the server's public IP explicitly.)

What's next
===========

After than, start deploying. My notes, the ones I use when I teach the class,
are available here. If you're not using Ubuntu 10.04 LTS then YMMV.
If you're not using Ubuntu 10.04 LTS then YMMV.

Further reading
===============
Expand All @@ -82,23 +55,25 @@ you read through all of it until you understand every command and
configuration option I've used, you'll be well on your way towards groking
this stuff. Good luck!

* Ubuntu_
* git_ (also see the `git book`_)
* Buildout_
* Django_; see particularly the `settings reference`_
* Apache_; the `directive quick reference`_ is especially useful
* mod_wsgi_
* `Django's mod_wsgi docs`_
* `mod_wsgi's Django docs`_
* Ubuntu_.
* git_ (also see the `git book`_).
* Pip_.
* Virtualenv_.
* Django_; see particularly the `settings reference`_.
* Apache_; the `directive quick reference`_ is especially useful.
* mod_wsgi_:
* `Django's mod_wsgi docs`_.
* `mod_wsgi's Django docs`_.
* Gunicorn_
* `PostgreSQL docs`_, including:
* `Server configuration`_ (``postgresql.conf``)
* `Client authentication`_ (``pg_hba.conf``)
* Fabric_
* Nginx_, specifically the upstream_ and proxy_ modules
* memcached_
* Django's `caching framework`_
* pgpool2_
* pg_standby_
* `Server configuration`_ (``postgresql.conf``).
* `Client authentication`_ (``pg_hba.conf``).
* Fabric_.
* Nginx_, specifically the upstream_ and proxy_ modules.
* memcached_.
* Django's `caching framework`_.
* pgpool2_.
* Chef_, specifically `Chef Solo`_.

.. _ubuntu:
.. _git: http://git-scm.com/documentation
Expand All @@ -115,4 +90,6 @@ this stuff. Good luck!
.. _upstream: http://wiki.nginx.org/NginxHttpUpstreamModule
.. _proxy: http://wiki.nginx.org/NginxHttpProxyModule
.. _`caching framework`: http://docs.djangoproject.com/en/dev/topics/cache/
.. _pgpool2: http://pgpool.projects.postgresql.org/pgpool-II/doc/pgpool-en.html
.. _pgpool2: http://pgpool.projects.postgresql.org/pgpool-II/doc/pgpool-en.html
.. _chef: http://wiki.opscode.com/display/chef/Home
.. _chef solo: http://wiki.opscode.com/display/chef/Chef+Solo

0 comments on commit 3e24115

Please sign in to comment.