은 내가 pcreate 사용하여 만든 피라미드 Fanstatic 응용 프로그램이 아파치 WSGI 모듈에서 정적 리소스를 찾을 수 없습니다 : 나는를 시작하는/빈/pserve-fanstatic 사용하는 경우피라미드 - fanstatic 응용 프로그램이
pcreate -s starter -s pyramid_fanstatic
모든 작품을 좋아을 섬기는 사람. 그러나 Apache WSGI 모듈을 사용하여 앱을로드하면
<link rel="stylesheet" type="text/css" href="/fanstatic/services/bootstrap/bootstrap.min.css" />
은 Apache에서 404를 찾을 수 없음을 반환합니다.
이 내 WSGI 응용 프로그램입니다 :
import os
activate_this = os.path.join('/opt/services/services/bin/activate_this.py')
execfile(activate_this, dict(__file__=activate_this))
os.environ['PYTHON_EGG_CACHE'] = '/opt/services/python-eggs'
from pyramid.paster import get_app, setup_logging
ini_path = '/opt/services/services/development.ini'
setup_logging(ini_path)
application = get_app(ini_path, 'main')
이 내 아파치의 conf 파일입니다
<VirtualHost *:80>
ServerAdmin [email protected]
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>
내가 빈/pserve-fanstatic 응용 프로그램을로드하기 전에 내 자원 디렉토리를 포함/것을 볼 수있다 :
"""A script aware of static resource"""
import pyramid.scripts.pserve
import pyramid_fanstatic
import os
dirname = os.path.dirname(__file__)
dirname = os.path.join(dirname, 'resources')
pyramid.scripts.pserve.add_file_callback(
pyramid_fanstatic.file_callback(dirname))
pyramid.scripts.pserve.main()
하지만 init.py에 이러한 줄을 포함하더라도 Apache는 fansta를 찾을 수 없습니다. tic 리소스.
나는 또한 나의 INI 파일이 추가 :
[filter:fanstatic]
use = egg:fanstatic#fanstatic
[pipeline:main]
pipeline = fanstatic services
내가 다른 무엇을 확인해야 /합니까?
예 : [: 주요 응용 프로그램] :
문서 당에서
내가있는 INI 파일에이 줄을 추가했다 내 대답에서 지적한대로 ini 파일에 일부 구성이 끝났습니다. – QLands