In Pylons I have a mako template linking to /static/resource.css
. How do I automatically link to /pylons/static/resource.css
when I decide to map the application to a subdirectory on my web server?
views:
314answers:
2
+1
A:
What you want are static routes:
map.connect('resource', '/static/resource.css', _static=True)
iElectric
2009-08-03 21:11:21
+2
A:
If you want your static file links to be relative to your app root, wrap them like this in your templates (assuming Mako and Pylons 0.9.7):
${url('/static/resource.css')}
The root path of your app will be prepended. No need to define specific routes for each file.
Jason S
2009-08-25 21:35:22