Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/300.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Pyramid-fanstatic应用程序无法在apache wsgi模块下找到静态资源_Python_Apache_Mod Wsgi_Pyramid_Fanstatic - Fatal编程技术网

Python Pyramid-fanstatic应用程序无法在apache wsgi模块下找到静态资源

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创建了一个静态应用程序:

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提供静态文件。见:

已修复

我必须在[app:main]中的ini文件中添加以下行:

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