开发者

Django / MacOS revised efficient development workflow

开发者 https://www.devze.com 2023-03-20 03:46 出处:网络
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 an

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)

Django / MacOS revised efficient development workflow

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

  1. Everything under www (ignoring .pyc's) is stored in your SCM.
  2. Create your Komodo project inside the www tree and ensure that you add the ../lib/python2.7/site-packages/ tree to your project.
  3. 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
  4. 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...


As Daniel pointed out this isn't a question per se. So there isn't an answer - other than sure..

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号