现在的位置: 首页 > 综合 > 正文

开源电子书发布平台Booktype搭建

2013年10月05日 ⁄ 综合 ⁄ 共 882字 ⁄ 字号 评论关闭

1、基础环境

安装CentOS5.5(64bit), Python升级到2.7.3(Booktype需要Python2.5以上版本),安装pip1.2, 安装apt-get 0.5.15, 安装git 1.8

安装Django框架1.4版本:

https://docs.djangoproject.com/en/dev/topics/install/#installing-official-release

2、安装依赖库

#database use pqsql

pip-2.7 install postgres

pip-2.7 install python-psycopg2

安装redis server, simplejson, lxml, South, unidecode

3、安装Booktype:

1) 获取软件包

git clone https://github.com/sourcefabric/Booktype.git

2) 更换路径

cd Booktype/scripts

3) 建立网站根路径

sudo mkdir /home/www/pysite/mybooktype/
sudo chown www:www /home/www/pysite/mybooktype/

4) 创建数据库实例

./createbooki --database postgresql /var/www/mybooktype/

5) 更换路径
cd /var/www/mybooktype/

6) 加载环境变量

. ./booki.env

7) 初始化数据库

django-admin.py syncdb --noinput

8) 迁移数据

django-admin.py migrate

9) 创建超级用户

django-admin.py createsuperuser

10) 添加公共文档授权

django-admin.py loaddata documentation_licenses

11) 启动该网站

django-admin.py runserver 0.0.0.0:8000

另外如果希望脱离console执行,可把booki.env里面的内容添加到/etc/profile中去

---------

iefreer

抱歉!评论已关闭.