apache + mod_wsgi + django + askbot

时间:2012-08-20 02:07:27

标签: django apache askbot

  

错误:文件不存在:   /home/WorkSpace/fenxiang/site_media/media/photos/3.jpg真实   地址3.jpg在   /home/WorkSpace/fenxiang/askbot/upfiles/photos/3.jpg

所有apalication运行良好python manage.py runserver

centos6.2 python2.7(/opt/python2.7.2)

hpptd.conf

<VirtualHost *:80>

    ServerAdmin matt@360yuer.com
    ServerName www.360yuer.com
    DocumentRoot /home/WorkSpace/fenxiang

    WSGIScriptAlias / /home/WorkSpace/fenxiang/apache/fenxiang.wsgi

    Alias /site_media/ /home/WorkSpace/fenxiang/site_media/
    Alias /upfiles/ /home/WorkSpace/fenxiang/askbot/upfiles/

    Alias /static/ /home/WorkSpace/fenxiang/static/ 
    AddType text/html .py

    <Directory  /home/WorkSpace/fenxiang/apache >
       Order allow,deny
        Allow from all
    </Directory>

    <Directory /home/WorkSpace/fenxiang/site_media>
        AllowOverride None
        Options None
        Order deny,allow
        Allow from all
    </Directory>
    <Directory /home/WorkSpace/fenxiang/askbot/upfiles>
                Order deny,allow
                Allow from all
        </Directory>

    <Directory /home/WorkSpace/fenxiang/static>
        Order deny,allow
        Allow from all
    </Directory>

</VirtualHost>

我是新手,我不知道如何解决, 目前的问题是找不到/askbot/upfiles/3.jpg,以及/ static / css中的一些css

settings.py

 STATICFILES_DIRS = (os.path.join(ASKBOT_ROOT, 'skins'), os.path.join(PROJECT_ROOT, "static"), ASKBOT_EXTRA_SKINS_DIR)
 RECAPTCHA_USE_SSL = True

1 个答案:

答案 0 :(得分:1)

而不是:

/askbot/upfiles/3.jpg

您应该使用以下网址:

/upfiles/3.jpg

在里面。这就是Alias设置的目的。

对于CSS文件,它们实际上在目录中:

/home/WorkSpace/fenxiang/static/css/