This is meant to be a blank django project template that uses Chef to provision the server where your application will be deployed. It also uses Vagrant to create the same environment in a Virtualbox VM.
I have made some choices as to how the django application will be deployed. This is based on the content and recommendations stemming from Djangocon 2011. The following will be installed.
- Ubuntu server
- nginx
- gunicorn
- postgresql
- memcached
- rabbitmq
- celery
Of course, other small applications will be installed to ensure smoother execution:
- virtualenv & pip
- git
- Python driver for postgresql
- etc
- Install Vagrant
- Download the
precise32
box and add it asprecise32
- Your django project should live in
coolname
. (i.e.coolname/settings.py
) - Add
coolname
(or what you change it to) to/etc/hosts
- Please change the name of the directory to match your project
- The name of the project has to be changed in a few other places
fabfile.py
node.json
- Run
vagrant up
to build the VM - Run
vagrant ssh
and add thecoolname
user tosudoers
- Then run
fab -R vagrant bootstrap
which will create a virtualenv, load your code, install dependencies, sync your db, etc. - Open your browser at
http://coolname:8844
.
The main fabfile
includes some special logic to work around some of the
limitations of vagrant. Nothing too hacky though. Every time you want to
execute something on your local VM, include the -R vagrant
flag.
You can change the password in the djangoapp/recipes/default.rb
file. Find
the user
block and change the value of the password
attribute. It should
be a salted hash, not plaintext. To create a new password, run:
$ openssl passwd -1 "theplaintextpassword"
And paste the result into the recipe file.
The password for the coolname
user is coolname
.
- Turn this into a scaffolding command with options
- Fix the fabfile
- Use supervisord for celery and gunicorn
- Use chef to manage configuration
- Bring RabbitMQ back
- Add optional install of flower
- Add better Chef installation
- Test on real server (i.e. not Vagrant)
BSD, short and sweet
-
0.5.0 (2012-07-17)
- Upgrade to Ubuntu 12.04
- Upgrade to postgresql 9.1
- Upgrade to Python 2.7
- Add vim package
-
pre-0.5.0 (2012-07-16)
- Distant past