beego虽然是一个简单的框架,但是其中用到了很多第三方的包,所以在你安装beego的过程中Go会自动安装其他关联的包。
- 当然第一步你需要安装Go,如何安装Go请参考我的书
- 安装beego
go get github.com/astaxie/beego
- 安装bee工具,这个工具可以用来快速的建立beego的应用
go get github.com/beego/bee
这样就完成了beego的安装,你就可以开始开发了,可以通过bee工具来创建beego项目
beego依赖的第三方包有如下:
- session模块:github.com/astaxie/beego/session
- session模块中支持redis引擎:github.com/garyburd/redigo/redis
- session模块中支持mysql引擎:github.com/go-sql-driver/mysql
- 模板函数中支持markdown转化:github.com/russross/blackfriday
新建项目
通过如下命令创建beego项目,首先进入gopath/src目录
adeMacBook-Pro:src apple$ bee new myproject
[INFO] Creating application...
/Users/apple/Documents/dev/go/src/myproject/
/Users/apple/Documents/dev/go/src/myproject/conf/
/Users/apple/Documents/dev/go/src/myproject/controllers/
/Users/apple/Documents/dev/go/src/myproject/models/
/Users/apple/Documents/dev/go/src/myproject/routers/
/Users/apple/Documents/dev/go/src/myproject/tests/
/Users/apple/Documents/dev/go/src/myproject/static/
/Users/apple/Documents/dev/go/src/myproject/static/js/
/Users/apple/Documents/dev/go/src/myproject/static/css/
/Users/apple/Documents/dev/go/src/myproject/static/img/
/Users/apple/Documents/dev/go/src/myproject/views/
/Users/apple/Documents/dev/go/src/myproject/conf/app.conf
/Users/apple/Documents/dev/go/src/myproject/controllers/default.go
/Users/apple/Documents/dev/go/src/myproject/views/index.tpl
/Users/apple/Documents/dev/go/src/myproject/routers/router.go
/Users/apple/Documents/dev/go/src/myproject/tests/default_test.go
/Users/apple/Documents/dev/go/src/myproject/main.go
2015/11/05 23:55:46 [SUCC] New application successfully created!
http://beego.me/docs/install/bee.md
http://my.oschina.net/astaxie/blog/124040