Skip to content
This repository was archived by the owner on May 3, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 27 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,39 @@
vagrant-django-base
===================
Vagrant box for Django development
==================================

A Vagrant box based on Ubuntu trusty32, configured for Django development
according to Torchbox's adopted practices. Things preinstalled beyond the base
trusty32 box include:
A Vagrant box based on Ubuntu trusty32, with the dependencies for developing Django projects preinstalled.

* postgresql 9.3 (with locale fixed to create databases as UTF-8)
* virtualenv and virtualenvwrapper
* dependencies for Pillow, a drop-in replacement for the Python Imaging Library PIL
* a pip download cache pre-seeded with Django and various other common packages
* git (sometimes required for pip dependencies that aren't in PyPI)
* Node.js, CoffeeScript and LESS
Usage
-----

This box is available on Vagrant cloud (aka Atlas) so can be used by just setting your base box to ``torchbox/django``.

To create a new Vagrantfile that uses this box, run the following:

```
vagrant init torchbox/django
```

What's inside
-------------

- Python 2.7.9 with virtualenv and pip
- Python 3.4.3 with pip (use bundled pyvenv for virtual environments)
- NodeJS 0.12.3 with npm 2.9.1
- PostgreSQL 9.3.6
- Redis 2.8.4
- Vim, Git, GCC (with C++ support)
- Development headers for Python (2 and 3), PostgreSQL and some image libraries (libjpeg, zlib, etc)
- Prebuilt wheels for Pillow 2.8.1 and psycopg2 2.6 for both python versions (and pip configured to use them)

We use this box in conjunction with https://github.com/torchbox/vagrant-django-template
as the initial template for our Django projects. vagrant-django-template will
successfully build from a vanilla trusty32 base box, but using vagrant-django-base
instead will skip some of the time-consuming initial setup.

Build instructions
------------------

To generate the .box file:

./build.sh

To install locally:

vagrant box add django-base-v2.2 django-base-v2.2.box
vagrant box add django-base-v3.0.0 django-base-v3.0.0.box
32 changes: 6 additions & 26 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,10 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant::Config.run do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "ubuntu/trusty32"

# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-i386-vagrant-disk1.box"

# Boot with a GUI so you can see the screen. (Default is headless)
# config.vm.boot_mode = :gui

# Assign this VM to a host only network IP, allowing you to access it
# via the IP.
# config.vm.network "33.33.33.10"

# Forward a port from the guest to the host, which allows for outside
# computers to access the VM, whereas host only networking does not.
# config.vm.forward_port "http", 80, 8080

# Share an additional folder to the guest VM. The first argument is
# an identifier, the second is the path on the guest to mount the
# folder, and the third is the path on the host to the actual folder.
config.vm.share_folder "v-data", "/vagrant_data", "./data"

# Enable provisioning with a shell script.
config.vm.provision :shell, :path => "install.sh"
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty32"
config.vm.provision :shell, :path => "install/install.sh"
end
10 changes: 6 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/bin/bash

# to build django-base-v2.box:
# to build django-base-v3.0.0.box:
vagrant destroy
vagrant up
rm -f django-base-v2.2.box
vagrant package --output django-base-v2.2.box
vagrant halt
rm -f django-base-v3.0.0.box
vagrant package --output django-base-v3.0.0.box

# to install locally:
# vagrant box add django-base-v2.2 django-base-v2.2.box
# vagrant box add django-base-v3.0.0 django-base-v3.0.0.box
103 changes: 0 additions & 103 deletions data/bashrc

This file was deleted.

8 changes: 0 additions & 8 deletions data/common_requirements.txt

This file was deleted.

68 changes: 0 additions & 68 deletions data/etc-bash.bashrc

This file was deleted.

89 changes: 0 additions & 89 deletions data/pg_hba.conf

This file was deleted.

Loading