Getting Started¶
Before you get started¶
You’ll need to install:
- rvm (and ruby >= 1.9)
- python (>= 2.7 & < 3)
- virtualenv
- nodejs (>= 0.8)
Get the code¶
Checkout the code from github:
git clone http://github.com/mattjmorrison/django-everything-template.git --recurse-submodulesGet up in there:
cd django-everything-template
Setup your Python environment¶
Create a virtualenv:
virtualenv myvirtualenvActivate the virtualenv:
source myvirtualenv/bin/activateInstall the development dependencies:
pip install -r devops/requirements/dev.txt
Setup your Ruby environment¶
Create a gemset:
rvm gemset create mygemsetActivate your gemset:
rvm use @mygemsetInstall the dependencies:
cd devops && bundle install && cd ..
Setup your Node.js environment¶
Install the dependencies:
cd devops && npm install && cd ..
Run the demo locally¶
Create a database:
./manage.py dev syncdb --migrate --noinputStart the development server:
./manage.py dev runserverNavigate to http://localhost:8000/demo/ to see that less and CoffeeScript are working
Navigate to http://localhost:8000/demo/person/ to see the RESTful ‘person’ resource is working
Create a local virtual production-like server¶
cd into the devops directory:
cd devopsadd a vagrant box (this will take a while):
vagrant box add ubuntu-12.04 http://dl.dropbox.com/u/1537815/precise64.boxcreate a new virtual server (this will also take a while):
vagrant upssh to the box and set the root password (this is used for the local deploy):
vagrant ssh sudo -i passwd #enter "test" when prompted
Deploy the project to the virtual production-like server¶
cd into the devops directory:
cd devopsuse capistrano to deploy (this will take a while):
cap deployNavigate to http://localhost:8080/demo/ to see that less and CoffeeScript are working
Navigate to http://localhost:8080/demo/person/ to see the RESTful ‘person’ resource is working