Webfaction上的Askbot静态文件未提供服务

时间:2012-10-17 12:02:16

标签: webfaction askbot

我按照http://community.webfaction.com/questions/8400/need-help-for-askbot-installation上的说明在webfaction服务器上部署了askbot脚本。我还做了运行python2.7 manage.py collectstatic和DEBUG设置为False。

当我访问我的网站时,它看起来像下图:http://dl.dropbox.com/u/750152/askbot.png

所有的css&图像渲染消失了。我错过了一些步骤吗?

1 个答案:

答案 0 :(得分:2)

您尚未创建仅限静态的应用以指向您的静态内容。 静态内容将由nginx前端服务器呈现。

以下是步骤 -

In the control panel, create a new app 

即使用

作为“仅限静态应用程序的符号链接”

/ home / username / webapps / askbot_server / myask / static作为符号链接路径。

Add the symlink app to your askbot site using '/m' as the URL path.

然后,

编辑/home/username/webapps/askbot_server/apache2/conf/httpd.conf将其更改为 -

<Directory /home/username/webapps/askbot_server/htdocs>
    AddHandler wsgi-script .py
</Directory>
to 

WSGIScriptAlias / /home/username/webapps/askbot_server/myask/django.wsgi
Restart your Apache with /home/username/webapps/askbot_server/apache2/bin/restart

此外,如果您使用posgresql作为数据库,要启用全文搜索,请运行

python manage.py init_postgresql_full_text_search