Python Pyramid-fanstatic应用程序无法在apache wsgi模块下找到静态资源
我使用pcreate创建了一个静态应用程序:Python Pyramid-fanstatic应用程序无法在apache wsgi模块下找到静态资源,python,apache,mod-wsgi,pyramid,fanstatic,Python,Apache,Mod Wsgi,Pyramid,Fanstatic,我使用pcreate创建了一个静态应用程序: pcreate -s starter -s pyramid_fanstatic 如果我使用/bin/pserve fanstatic启动服务器,一切正常。但是,当我使用Apache WSGI模块加载应用程序时,会出现如下链接: <link rel="stylesheet" type="text/css" href="/fanstatic/services/bootstrap/bootstrap.min.css" /> 这是我的Apac
pcreate -s starter -s pyramid_fanstatic
如果我使用/bin/pserve fanstatic启动服务器,一切正常。但是,当我使用Apache WSGI模块加载应用程序时,会出现如下链接:
<link rel="stylesheet" type="text/css" href="/fanstatic/services/bootstrap/bootstrap.min.css" />
这是我的Apache conf文件:
<VirtualHost *:80>
ServerAdmin a.orth@cgiar.org
ServerName data.ilri.org
# Pass authorization info on (needed for rest api).
WSGIPassAuthorization On
WSGIDaemonProcess services python-path=/opt/services/services display-name=services processes=2 threads=15
WSGIScriptAlias /services /opt/services/services/services/services.wsgi process-group=services application-group=%{GLOBAL}
<Location /services>
WSGIProcessGroup services
</Location>
ErrorLog /var/log/httpd/services.error.log
CustomLog /var/log/httpd/services.custom.log combined
</VirtualHost>
但是,即使我在init.py中包含这些行,Apache也无法找到fanstatic资源
我还将此添加到我的ini文件中:
[filter:fanstatic]
use = egg:fanstatic#fanstatic
[pipeline:main]
pipeline = fanstatic services
我还应该检查/做什么?您似乎没有告诉Apache提供静态文件。见:
fanstatic.publisher_signature = fanstatic
fanstatic.use_application_uri = true
根据文档:是的,我通读了它,尝试了一些东西,但最后是ini文件中的一些配置,正如我在回答中所指出的。
[filter:fanstatic]
use = egg:fanstatic#fanstatic
[pipeline:main]
pipeline = fanstatic services
fanstatic.publisher_signature = fanstatic
fanstatic.use_application_uri = true