OSQA本地部署出错

9 views
Skip to first unread message

tolerious feng

unread,
Oct 10, 2014, 10:19:31 AM10/10/14
to sp...@googlegroups.com
我想在本地部署一个OSQA,不用上uWSGI和Nginx,我说下我的部署步骤:
我的环境是:Ubuntu12.04,Python2.7.3,Django1.6.4,osqa的代码就是github上最新的代码,我的用户名就是osqa,osqa的代码我放在了/home/osqa/osqa-server目录下:
1. 下载软件,代码地址在:https://github.com/dzone/osqa
2.然后配置osqa.wsgi文件,
sys.path.append('/home/osqa')
sys.path.append('/home/osqa/osqa-server')
两行改为自己的实际路径,

os.environ['DJANGO_SETTINGS_MODULE'] = 'osqa-server.settings'
跟上面一步中的osqa-server保持一致
3.安装mysql5.5
apt-get install mysql-server mysql-client,设置好密码,
sudo mysql -u root -p
CREATE USER 'osqa'@'localhost' IDENTIFIED BY 'osqa';
CREATE DATABASE osqa DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci;
GRANT ALL ON osqa.* to 'osqa'@'localhost';
4.安装一些依赖
apt-get install python-dev python-mysqldb
pip install django-debug-toolbar makrdown South html5lib python-openid
5.配置settings_local.py文件
修改ALLOWED_HOSTS为ALLOWED_HOSTS = ('*',)
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'osqa',
        'USER': 'osqa',
        'PASSWORD': 'osqa',
        'HOST': '',
        'PORT': '',
        'CONN_MAX_AGE': 600,
    }
}
DEBUG = True
APP_URL = 'http://localhost'
6.运行
sudo python manage.py syncdb --all有提示选择no根据官网文档步骤来的
sudo python manage.py migrate forum --fake
7.运行python manage.py runserver
8.打开http://localhost


Reply all
Reply to author
Forward
0 new messages