On Jun 17, 5:28 am, Wichert Akkerman <[EMAIL PROTECTED]> wrote:
> Previously Antonio Beamud Montero wrote:
>
>
>
>
>
> > El mar, 17-06-2008 a las 04:33 -0700, Cliff Wells escribió:
> > > On Tue, 2008-06-17 at 10:36 +0200, Wichert Akkerman wrote:
> > > > Previously Cliff Wells wrote:
>
> > > > > I usually just setup Nginx to handle whatever location my static 
> > > > > content
> > > > > is at.  It doesn't matter if Routes is setup to handle that location 
> > > > > as
> > > > > the request never reaches Pylons.
>
> > > > How do you do that during development? Do you hardcode /public/ paths
> > > > for static resources everywhere?
>
> > > Actually, I never use webhelpers.  I generally use hardcoded paths in my
> > > template and map them in the webserver, but don't see what the issue
> > > would be when using webhelpers.  I don't see the whole process as being
> > > very complicated (nor any need to make it complicated).
>
> > Well, it can be complicated, for example, you are developing with paster
> > in the url localhost:5000/
> > But, in production, your web is served under
> >http://mydomain.com/cool/things/...
>
> And then you want to scale up even further and have to offload static
> resources to another machine. You don't want to have to edit all your
> templates to do that.

This is the setup I'm working with. I've been looking for a config
option in Pylons that would prepend a host to WebHelper paths. I
haven't been able to find it, so I might put together a patch.

To be clear, what I want is something like this in production.ini:

[app:main]
...
asset_host = http://assets.example.com  # Option name borrowed from
Rails
...

Then stylesheet_link_tag('base') would generate <link href="http://
assets.example.com/stylesheets/base.css" media="screen"
rel="Stylesheet" type="text/css" /> in production mode. When the
asset_host option isn't specified, the usual path would be generated.

This sort of thing is exactly the reason to be using WebHelpers, IMO.

-wlb


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to