Django1.4上部署OSQA

OSQA默认支持Django1.3.

部署OSQA前,需要安装python,以及如下模块:

1、django        
2、markdown      
3、html5lib      
4、south         
5、python-openid

一、如果是在Django1.3下,则出现了ImportError: cannot import name mark_safe错误;

解决办法是

1、修改forum/utils/html.py,     from django.utils.safestring import mark_safe
2、再修改forum/urls.py文件,url(r'^%s(.*)' % _('nimda/'), admin.site.urls),

二、如果选择使用Django1.4,则启动后会报错:

"'module' object has no attribute 'load_template_source'"

ImproperlyConfigured: settings.DATABASES is improperly configured

Module "django.core.context_processors" does not define a "auth" callable request processor

这三个错误,现在需要作如下修改:

1、settings.py,     TEMPLATE_LOADERS中去掉两个load_template_source,加上一行'django.template.loaders.filesystem.Loader'

2、settings.py,    TEMPLATE_CONTEXT_PROCESSORS中去掉context_processors.auth,加上'django.contrib.auth.context_processors.auth'

3、settings_local.py,    DATABASE的配置要全部去掉,采用如下形式:

DATABASES ={

  'default':{

       'ENGINE':'django.db.backends.oracle',# Add 'postgresql_psycopg2','postgresql', 'mysql', 'sqlite3' or 'oracle'.

       'NAME':'XE',                     # Or path to database file if using sqlite3.

       'USER':'osqa',                     # Not used with sqlite3.

       'PASSWORD':'osqa',                 # Not used with sqlite3.

       'HOST':'localhost',                     # Set to empty string for localhost. Not used with sqlite3.

       'PORT':'1521',                     # Set to empty string for default. Not used with sqlite3.

    }

}

现在应该就能启动成功并能访问页面了。

祝你成功!


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值