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.
}
}
现在应该就能启动成功并能访问页面了。祝你成功!