I've been now happily developing applications (Django in particular) on the Mac for a few years now. As part of this process I am always looking to gain efficiencies in my workflow and enjoy reading about other development expieriences. Now it's my turn to give back. This is a revision to my previous post with time and expierience under my belt.
Tools of the trade
- A Mac Loaded up with XCode
- A good set of gnu tools (coreutils, findutils, diffutils...)
- A solid set of SCM's git, mercurial, perforce, svn (if needed..)
- iTerm2 - This simply is awesome.
- ActivePython - The free version → with easy_install, pip, distribute, ipython, pylint available to all.
- Komodo - (Yes I paid for this) Have tried textmate, eclipse, pycharm, Komodo simply has most everything I need.
- Dropbox (sharing) / Omnigraffle (mockups) / Omnifocus (planning)
The structure
~/Users/<username>
/Dropbox/Projects/<project_name>
/Documents (Personal Documents relating to the project)
/Public (Public Documents shared with customer)
/Projects/<project_name>
/Documents ../Dropbox/Projects/<project_name>/Documents
/Public ../Dropbox/Projects/<project_name>/Public
/Development
<virtual_env>
Starting Out
Create a virtual env and get it activated.
$ cd ~/Users/<username>/Projects/<project_name>/Development
$ virtualenv --no-site-packages --distribute <project>_django
$ cd <project>_django; . ./bin/activate
$ echo "alias <project>d="cd ~/Projects/<project_name>/Development/<project_django/www/; . ../bin/activate" > ~/.bash_profile
Get core modules installed and start a django project.
$ pip install django django-debug-toolbar dbgp
$ django-admin.py startproject www
$ pip freeze > www/requirements.txt
Go forth and develop.
$ cd www
$ django-admin.py startapp core
Comments
- Everything under
www
(ignoring .pyc's) is stored in your SCM. - Create your Komodo project inside the www tree and ensure that you add the
../lib/python2.7/site-packages/
tree to your project. - In Komodo I created several macros which really help me out
- Debug session runs
./manage.py runserver
under pydb which allows good introspection and awesome debugging capability all from within Komodo (as shown above). This is also available in PyDev. If interested I can share this. It requires #2 for scalability. - Pylint - Run pylint on your code and ensure at least 8.75 score.
- Tab Titles - Shamelessly swiped and tweaked from here
- Debug session runs
- I use iTerm for
./manage.py shell_plus
- This is way superior than the Komodo built in interpreter.
Thoughts??
Please share your views and point out areas for improvement. I'm always searching for better ways of doing things...