Django Everything Template beta documentation

Getting Started

«  About   ::   Contents   ::   Testing  »

Getting Started

Before you get started

You’ll need to install:

  1. rvm (and ruby >= 1.9)
  2. python (>= 2.7 & < 3)
  3. virtualenv
  4. nodejs (>= 0.8)

Get the code

  1. Checkout the code from github:

    git clone http://github.com/mattjmorrison/django-everything-template.git --recurse-submodules
  2. Get up in there:

    cd django-everything-template

Setup your Python environment

  1. Create a virtualenv:

    virtualenv myvirtualenv
  2. Activate the virtualenv:

    source myvirtualenv/bin/activate
  3. Install the development dependencies:

    pip install -r devops/requirements/dev.txt

Setup your Ruby environment

  1. Create a gemset:

    rvm gemset create mygemset
  2. Activate your gemset:

    rvm use @mygemset
  3. Install the dependencies:

    cd devops && bundle install && cd ..

Setup your Node.js environment

  1. Install the dependencies:

    cd devops && npm install && cd ..

Run the demo locally

  1. Create a database:

    ./manage.py dev syncdb --migrate --noinput
  2. Start the development server:

    ./manage.py dev runserver
  3. Navigate to http://localhost:8000/demo/ to see that less and CoffeeScript are working

  4. Navigate to http://localhost:8000/demo/person/ to see the RESTful ‘person’ resource is working

Create a local virtual production-like server

  1. cd into the devops directory:

    cd devops
  2. add a vagrant box (this will take a while):

    vagrant box add ubuntu-12.04 http://dl.dropbox.com/u/1537815/precise64.box
  3. create a new virtual server (this will also take a while):

    vagrant up
  4. ssh 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

  1. cd into the devops directory:

    cd devops
  2. use capistrano to deploy (this will take a while):

    cap deploy
  3. Navigate to http://localhost:8080/demo/ to see that less and CoffeeScript are working

  4. Navigate to http://localhost:8080/demo/person/ to see the RESTful ‘person’ resource is working

«  About   ::   Contents   ::   Testing  »