From zero to Django: get Django going in windows within minutes

My 5-step banana ice cream recipe got more reaction in one hour than my usual geeky posts in years. Maybe I should combine the two concepts! Or maybe not. Heck, I already like this title so here’s the geeky recipe: a decidedly imperfect recipe for getting my django project up and running on a fresh new install of windows.

Preparation time

minutes!

Ingredients

Preparation

  1. (optional) Install putty, create ssh key with puttygen, save private and public keys, add to authorized_keys on repository server, start pagent, add the key to it.

  2. Install python, install setuptools

  3. Edit environmental variables:
    1. Append to PATH: c:\python27;c:\python27\scripts
    2. Set BZR_SSH=c:\program files\putty\plink.exe
  4. (optional) Install git

  5. Fire up the bash terminal (git bash or DOS command prompt)

  6. easy_install pip

  7. (optional) Install Bazaar, bzr co bzr+ssh://myserver/~/repos/project

  8. Install Django using pip: pip install django==1.4 (use the version you need!)

  9. Install dependencies of the Django project, typically listed in a file: pip install -r requirements.txt

  10. Run in Django’s local server: python manage.py runserver

Best served in a modern browser like Chrome at http://localhost:7000/ Enjoy!

Variations for the more adventurous

  • Screw putty, use the openssh that comes with git bash
  • pip install virtualenv, create a virtual env and run Django inside it.