Django/MacOS修订的高效开发工作流程 [英] Django / MacOS revised efficient development workflow
问题描述
几年来,我一直在Mac上愉快地开发应用程序(尤其是Django).作为此过程的一部分,我一直希望在工作流程中提高效率,并喜欢阅读有关其他开发经验的文章.现在轮到我回馈了.这是对我以前的帖子的修订.和经验带给我.
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.
交易工具
- 装有 XCode 的Mac
- 一组不错的gnu工具( coreutils , diffutils ...)
- 一组可靠的SCM git , perforce ,svn(如果需要).
- iTerm2 -这真是太棒了.
- ActivePython -免费版本→所有人均可使用easy_install,pip,distribution,ipython,pylint .
- 科莫多岛-(是的,我为此付费)尝试了textmate,eclipse,pycharm,科莫多只是拥有我所需的大部分东西.
- Dropbox (共享)/ Omnifocus (计划中)
- 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)
结构
~/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>
开始
创建一个虚拟环境并激活它.
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
安装核心模块并启动django项目.
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
继续发展.
$ cd www
$ django-admin.py startapp core
评论
-
www
下的所有内容(忽略.pyc)都存储在您的SCM中. - 在www树中创建您的Komodo项目,并确保将
../lib/python2.7/site-packages/
树添加到您的项目中. - 在科莫多,我创建了几个宏,这些宏对我有很大帮助
- 调试会话在pydb下运行
./manage.py runserver
,这可以从Komodo内部进行良好的自省和强大的调试功能(如上所示).这在PyDev中也可用.如果有兴趣,我可以分享.它需要#2的可伸缩性. - Pylint-在您的代码上运行pylint,并确保至少获得8.75分.
- 标签标题-从此处
- 调试会话在pydb下运行
- 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
想法?
请分享您的观点并指出需要改进的地方.我一直在寻找更好的做事方式...
Please share your views and point out areas for improvement. I'm always searching for better ways of doing things...
推荐答案
正如丹尼尔(Daniel)指出的那样,这本身不是问题.因此,除了确定以外,没有其他答案.
As Daniel pointed out this isn't a question per se. So there isn't an answer - other than sure..
这篇关于Django/MacOS修订的高效开发工作流程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!