diff --git a/index.html b/index.html
index 79cf34b..0abcb82 100644
--- a/index.html
+++ b/index.html
@@ -20,6 +20,10 @@
我们也欢迎在算法/前端/设计方面有能力的同学们, 这个社区同样有很多东西等你来
+**WARNING** 我们最近在做嵌入react的工作,其他工作暂停迭代(防止新的代码造冲突).
+
+具体讨论可见: [Issue92](https://github.com/python-cn/firefly/issues/92),开发详情请关注[trello](https://trello.com/b/JM2OEXPA/firefly)
+
愿景:
* 社区不是一个人的或者几个人写的, 而是很多人贡献代码产生的(包含基本的功能).
diff --git a/posts/flow-and-standards.md b/posts/flow-and-standards.md
index e5f7cff..c2e4bf6 100644
--- a/posts/flow-and-standards.md
+++ b/posts/flow-and-standards.md
@@ -3,6 +3,9 @@ title: 开发流程&代码规范
假如你想参与firefly的开发, 请详细阅读此文.
+**WARNING** 我们最近在做嵌入react的工作,其他工作暂停迭代(防止新的代码造冲突).
+具体讨论可见: [Issue92](https://github.com/python-cn/firefly/issues/92),开发详情请关注[trello](https://trello.com/b/JM2OEXPA/firefly)
+
### 说在前面的话
「再牛掰的人写的程序也会有bug. 」
@@ -167,12 +170,18 @@ pr还有2种特殊的用法:
1. 写代码的时候尽量支持python2+python3
2. 希望更多愿意尝试python3的同学参与进来
+写兼容python3的代码可以参看 [python3兼容的代码](/#/post/porting3.md)
+
### 代码规范
「无规矩不成方圆!」
我坚信一个健康成长的社区,需要一帮有自己品位, 态度的维护者和开发者. 为了保证社区代码的质量, 我希望每个开发者都能遵守以下一些准则
+#### 代码规范
+
+要先读读 https://github.com/mdo/code-guide
+
#### CSS
项目使用scss, 不能直接修改css. 这样的代码修改是不会被merge的
diff --git a/posts/list.md b/posts/list.md
index 96f842b..3de323e 100644
--- a/posts/list.md
+++ b/posts/list.md
@@ -10,6 +10,9 @@ url: new.md
title: 开发流程&代码规范
url: flow-and-standards.md
-------
+title: 写python3兼容的代码
+url: porting3.md
+-------
title: python学习之路
url: material.md
-------
diff --git a/posts/new.md b/posts/new.md
index c95ba62..942167a 100644
--- a/posts/new.md
+++ b/posts/new.md
@@ -37,7 +37,7 @@ PS: virtualenv是一个虚拟环境, 主要解决多python环境下依赖不相
PS: 你需要Python Development Headers来作为依赖安装py-bcrypt包,如果你使用的是Mac OS或者Windows,你应该已经有了这个依赖。否则如果是Debian系的发行版需要安装python-dev包,如果是RedHat系的发行版需要安装python-devel包。
```
-#### 初始化firfly的开发环境
+#### 初始化firefly的开发环境
```python
$git clone https://github.com/python-cn/firefly # 克隆代码到本地
@@ -46,9 +46,7 @@ $cp firefly/local_settings.py.example firefly/local_settings.py # local_settings
库, oauth2等不适合放入版本库敏感数据,以及对一些配置项的自定义
$virtualenv venv # 在当前目录下生成一个venv目录, 这个目录就是你的虚拟环境
$source venv/bin/activate # 激活环境, 如果你想从这个环境中离开, 可以执行`deactivate`
-$pip install -r requirements.txt # 安装firefly的python依赖
$pip install -r py2-requirements.txt # 假如你是用python2还需要安装这个依赖
-# 安装开发依赖, 不做开发不需要安装
$pip install -r dev-requirements.txt # 安装开发依赖
$pre-commit install -t pre-push # 假如你希望对flake8做本地检查可以安装这个git-hook. 以后每次你的push都会跑一遍对当前提交代码中的检查
```
@@ -72,10 +70,17 @@ PS: pre-commit请放心使用, 代码是我写的.
2. 其次需要安装ruby(我们会使用gem), 可以到官网 https://www.ruby-lang.org/ 下载安装
3. 配置firefly的开发环境
- cd firefly/static
- sudo gem install sass
- npm install
- node_modules/grunt-cli/bin/grunt # 如果你不喜欢占用一个终端, 可以使用tmux或者screen
+
+ $ cd firefly/static
+ $ gem sources --remove https://rubygems.org/
+ $ gem sources -a https://ruby.taobao.org/
+ $ gem sources -l
+ *** CURRENT SOURCES ***
+
+ https://ruby.taobao.org
+ $ sudo gem install sass -V
+ $ npm install
+ $ node_modules/grunt-cli/bin/grunt # 如果你不喜欢占用一个终端, 可以使用tmux或者screen
#### 填充测试数据
diff --git a/posts/porting3.md b/posts/porting3.md
new file mode 100644
index 0000000..92d98b9
--- /dev/null
+++ b/posts/porting3.md
@@ -0,0 +1,52 @@
+title: 写python3兼容的代码
+-------------------------
+
+假如你想参与firefly的开发, 我们原则上要求写能支持py2且支持py3的代码.
+
+### 资料
+
+从开发角度了解python3的意义: http://ncoghlan-devs-python-notes.readthedocs.org/en/latest/python3/questions_and_answers.html
+
+书: http://python3porting.com/
+
+链接: https://docs.python.org/3.3/howto/pyporting.html
+
+### python-modernize
+
+如果你对python3不熟悉 可以使用[python-modernize](https://github.com/mitsuhiko/python-modernize)跑一下代码, 它会演示建议你需要修改的地方:
+
+```python
+python-modernize --no-six -w firefly/app.py
+```
+
+### firefly目前的做法
+
+我们既没有使用six, 也没有使用future, 而是维护了firefly/six.py
+
+原因是 我们遇到的坑还少, six/future需要开发者熟悉它的解决方案. 我们只需要添加有限的几种问题即可(自己添加会更熟悉和趁手)
+
+PS:不排除未来我们也会使用six/future作为我们的方案.
+
+### firefly兼容要求
+
+1. 不要显式的使用u''. 因为在python3.3之前这是语法错误.
+2. 有print的时候, `from __future__ import print_function`是必须的
+3. 每个新的py文件都要求 加上 `from __future__ import absolute_import`. 因为python3不支持隐式的相对import. 详见[PR#74](https://github.com/python-cn/firefly/pull/74)
+5. open文件请使用` io.open()`
+5. 类都要继承object(新式类)
+6. 模块和方法改变的列表以及一些其他的要注意的点可以看这里: http://docs.pythonsprints.com/python3_porting/py-porting.html
+
+### python -3
+
+可以使用-3启动web. Python会warn一些信息告诉你那些东西可能在py3已经被废弃或者有更新的用法
+
+```python
+python -3 manage.py runserver
+```
+
+### 链接
+
+1. http://techspot.zzzeek.org/2011/01/24/zzzeek-s-guide-to-python-3-porting/
+2. http://dabeaz.blogspot.com/2011/01/porting-py65-and-my-superboard-to.html
+3. http://lucumr.pocoo.org/2010/2/11/porting-to-python-3-a-guide/
+4. http://lucumr.pocoo.org/2011/1/22/forwards-compatible-python/
diff --git a/posts/pythonista.md b/posts/pythonista.md
index 095a3c3..bb89603 100644
--- a/posts/pythonista.md
+++ b/posts/pythonista.md
@@ -17,13 +17,16 @@ python-china现在还是很冷清, 远没有ruby-china和cnodejs这些社区的
原因很简单, 相同性价比下人太难招了. 我记得有一天, 一个猎头找我, 聊得过程中发现她对python有很多偏见, 它觉得中国搞python的人也就那几百个..
虽然是个特例, 还是让我很有感触. 来豆瓣之前, 上一家公司有十多个产品线, python只有2-3个. 我都要离职了才发现, 好几个人竟然一直以为我是做ruby的. 囧
-不记得在哪里看过, 程序员有三种表白:
+不记得在哪里看过, 程序员有三种(我重新润色了一下):
1. 拿钱干活, 不爽就换 - 程序员只是一份工作
-2. 只要能实现功能就好, 学习进步太累了. 这年代做技术没有管理挣钱多, 技术搞得再好有什么用? 还不是买不起房. 这年代关键是你认识多少人. 能不能唬住粉丝儿和投资人
-3. 热爱程序本身的人, 这些人可能只有1%, 他们有目标的写程序, 他们愿意思考, 愿意听取正确地/更好的方法, 他们会热爱学习新的东西 - Geek
+2. 只要能实现功能就好, 学习进步太累了. 这年代做技术没有管理挣钱多, 技术搞得再好有什么用? 还不是买不起房. 这年代关键是你认识多少人. 你是不是有眼光去一个能上市会让你暴富的公司, 能不能唬住粉丝儿和投资人.
+3. 热爱程序本身的人, 这些人可能只有1%, 他们有目标的写程序, 他们愿意思考, 愿意听取正确地/更好的方法, 他们会热爱学习新的东西
-人们都会把大部分的功劳交给产品, 销售和管理者. 只是程序员这个职业情况相对还好. 虽然架构师这个位置来说, 第二种人反而更多.
+在生活中绝大多数都是前2种人. 尤其是第二种,我是可以理解的, 因为人们都会把大部分的功劳交给产品, 销售和管理者.
+
+尤其是最近, 身边总是会有很多声音: 你要创业其实更多的不是技术, 而是balabala... 我是部分认同的: 我不认同的是过于放低技术对创业期间的作用. 我很难相信一个视野不够高度,
+不够宽度的人去创业的成功几率. 想想我自己还是蛮low的(我知道我前端能力还不够)
再说2个例子吧.
diff --git a/posts/used.md b/posts/used.md
index 2dd83a9..260dcdb 100644
--- a/posts/used.md
+++ b/posts/used.md
@@ -25,9 +25,11 @@ firefly的数据库. 选择Mongodb就是因为社区在早期可能功能特性
在使用ORM这个问题上一直有很大的争议. 我以前试验过, 使用ORM会减低3-5%的性能. 但是能让代码好看简单很多.
出现问题也很容易定位. 给想学想用它的人作为一个范例吧.
-#### plim
+#### Jinja2
-firefly的模板, plim我个人觉得是一个被严重低估的基于mako的模板. 这里用它其实是示范原因. 给想用plim的人一个范例.
+早期firefly使用了plim, 但是由于要使用react,以及plim被大家接受程度, 我们还是换回了jinja2.
+
+有兴趣可以看具体讨论: [Issue92](https://github.com/python-cn/firefly/issues/92),开发详情请关注[trello](https://trello.com/b/JM2OEXPA/firefly)
#### pygments
@@ -42,6 +44,11 @@ firefly的模板, plim我个人觉得是一个被严重低估的基于mako的模
### 前端的
+#### react
+
+[react](https://github.com/facebook/react)可能是目前最火的前端框架. firefly组件都由react来支持. 具体讨论可见: [Issue92](https://github.com/python-cn/firefly/issues/92).
+目前进行中, 欢迎有兴趣得人一起来做.
+
#### grunt
[grunt](https://github.com/gruntjs/grunt)是一个javascript的任务处理器(用了才知道).
firefly用来做代码更改自动执行sass, 重载页面, 代码压缩等
diff --git a/posts/welcome.md b/posts/welcome.md
index 18db44d..b0cd08f 100644
--- a/posts/welcome.md
+++ b/posts/welcome.md
@@ -40,7 +40,7 @@ title: 欢迎入伙
目前想做的一些东西:
1. 一个有社交元素的python社区(firefly)
-2. 给[pythoncn-slack](https://pythoncn.slack.com)写个被调戏的机器人
+2. 给[pythoncn-slack](https://pythoncn.slack.com)写个被调戏的机器人 - 完成: [slack_bot](https://github.com/python-cn/slack_bot)
3. 用react重写本手册
4. 一个使用markdown可预览的博客应用
5. 一个web框架