Django + Postgres + Virtualenv + MacOSX - Perfect Local Development Environment
Posted On: March 29, 2011 at 8:28 a.m.
Getting a local environment set up for Django development is remarkably easy these days but I thought I would write out the steps as I completed them on my new Macbook Pro. If you don’t need a full fledged database engine you can just skip step 2 and use SQLite which comes pre-installed.
- Mac’s come with Python already installed. To check what version you have open Terminal.app and type “python”. If you have a version older than 2.5 I would update to a later version.
- I prefer to work with a Postgres installation locally so I can easily import and export real data to and from a site. To install Postgres follow our installing Postgres on a Mac tutorial. Keep in mind that most servers will be running several versions back, so in this case I used the 8.3 version since its the most likely to match the version on the server and behave the same.
- Install virtualenv to easily duplicate and switch between server environments locally. Open terminal and run this: sudo easy_install virtualenv
- I found this guide to working with virtualenv to provide all the key commands for setting up and working on virtualenv.
- Install Django by following the instructions at the bottom of this page.
- Install other modules as needed for the project build.


Comments