On Wednesday, May 25, 2011 5:51:15 AM UTC-7, Geoff wrote:
>
> >
> > Sorry, I didn't see you were using Pylons 1.0, so my answer is actually
> > useless.
>
> Actually your answer is proving to be very useful, it got me thinking
> about the pylons routes dispatcher which is an area of pylons to which
> I have given very little attention. All I need to do is write a rule
> that matches the static path /xxx and then removes it. I don't know if
> this is possible with routes but I feel it must be so I'm going to
> give that a go and see if it works.
>
In your templates, use the `pylons.url` function to generate URLs:
${url('/css/blah.css')}
Pass the app prefix through to your JS, perhaps like this:
<script>
my_namespace.app_prefix = '${url("/")}';
var url = [my_namespace.app_prefix, '/some/path'].join('/'); // maybe
create a utility function for this
</script>
If you are running your app behind a proxy, you will need to use something
like Paste's PrefixMiddleware.
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.