I have a Pyramid-Fanstatic application that I created using pcreate:

pcreate -s starter -s pyramid_fanstatic

All works ok if I use /bin/pserve-fanstatic to start the server. However when I 
use the Apache WSGI module to load the app, a link like:


<link rel="stylesheet" type="text/css" 
href="/fanstatic/services/bootstrap/bootstrap.min.css" />
>
>
returns 404 Not Found by Apache.

This is my WSGI application:

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') 
>
>
This is my Apache conf file:

<VirtualHost *:80>
>     ServerAdmin a.o...@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>
>
>
I also added this to my ini file:

[filter:fanstatic]
> use = egg:fanstatic#fanstatic
> [pipeline:main]
> pipeline = fanstatic services
>
>
I can see that /bin/pserve-fanstatic includes my resource directory before 
loading the application:

"""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()
>
>
But even if I include such lines in my init.py Apache cannot find the 
fanstatic resources.

What else should I check/do?

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to