Skip to content

Instantly share code, notes, and snippets.

@shellfly
shellfly / README.mdown
Last active August 29, 2015 14:22 — forked from mtigas/README.mdown
TOTP (Google Authenticator) two-factor auth proof of concept.
@shellfly
shellfly / py-stack.md
Created September 19, 2012 04:48 — forked from flaneur2020/py-stack.md
notes on django

python的环境与ruby还是有很大不同的,而且框架多如牛毛,将遇到的坑记在这里。

ps: django跟屎一样。 pps: django还不错拉。

virtualenv

直觉上很容易当作virtualenv当作rvm的存在,但实际上python的版本往往并非大问题,更多需要对付的还是三方库。virtualenv其实更多扮演的是Bundler的角色,但在操作上有所不同。

Bundler通过Gemfile列出当前项目需要的gem并将它们安装到系统,在代码中通过Bundler.require(:all)引入gem,并在bundle exec中设置环境变量之类,以选择正确版本的gem。