一、安装mysql
rpm -ivh MySQL-client-5.5.20-1.linux2.6.x86_64.rpm
rpm -ivh MySQL-devel-5.5.20-1.linux2.6.x86_64.rpm
rpm -ivh MySQL-server-5.5.20-1.linux2.6.x86_64.rpm
rpm -ivh MySQL-shared-5.5.20-1.linux2.6.x86_64.rpm
二、安装python2.7.3
tar xzf Python-2.7.3.tar.gz
cd Python-2.7.3
./configure --prefix=/usr/local/;make;make install
操作系统版本:CentOS6.2_x64
三、安装插件
/usr/local/bin/easy_install ElementTree South markdown html5lib python-openid
四、安装django
tar -zxvf Django-1.3.1.tar.gz
cd Django-1.3.1
/usr/local/bin/python setup.py install
五、安装并配置OSQA应用
tar -zxvf fantasy-island-0.9.0-beta3.tar.gz
mv fantasy-island-0.9.0-beta3 osqa
cd osqa
mkdir cache
chmod u+w log forum/upfiles
5.1数据库配置
cp settings_local.py.dist settings_local.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'osqa',
'USER': 'root',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
LANGUAGE_CODE = 'zh_CN'
TIME_ZONE = 'Asia/Shanghai'
APP_URL = ''
DISABLED_MODULES = ['books', 'recaptcha', 'project_badges', 'oauthauth', 'facebookauth']
修改部分代码BUG
修改 /usr/local/src/osqa/forum/utils/html.py
将 django.template import mark_safe
变更为
from django.utils.safestring import mark_safe
修改 /usr/local/src/osqa/forum/urls.py
url(r'^%s(.*)' % _('nimda/'), admin.site.root),
变更为
url(r'^%s(.*)' % _('nimda/'), include(admin.site.urls)),
----------------------
六、生成数据库文件
python manage.py syncdb --all
python manage.py migrate forum --fake
----------------------
七、启动应用
nohup python manage.py runserver 8000 &
-----------------------------
八、Nginx反向代理及虚拟目录设置
location / {
proxy_pass
}
location /m {
alias /usr/local/src/osqa/forum/skins/;
}
location /upfiles {
alias /usr/local/src/osqa/forum/;
}
location /admin_media/ {
alias /usr/local/src/osqa/admin_media/;
}
九、启动Nginx程序
/usr/local/sbin/nginx
打开浏览器访问
#Django 编译语言模板
mange.py compilemessages
其它参考:
阅读(2078) | 评论(0) | 转发(0) |