On Wednesday 09 July 2008 20:58:42 aspineux wrote:
> On Jul 9, 4:32 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > can somebody give me a hint on how static content is served? I need to
> > "embed" the TG2-app into an existing wsgi-app below a certain path - and
> > obviously serving e.g. the CSS fails miserably. There was the old way of
> > using tg.url and server.webpath (or such) - any such facility available?
>
> It looks about the same as tg1, looks in controllers.py for tg.url
>
> def url(tgpath, tgparams=None, **kw):
> """
> url() re-implementation from TG1
> """
>
> if not isinstance(tgpath, basestring):
> tgpath = "/".join(list(tgpath))
> if tgpath.startswith("/"):
> app_root =
> pylons.request.application_url[len(pylons.request.host_url):]
> tgpath = app_root + tgpath
> tgpath = pylons.config.get("server.webpath", "") + tgpath
> result = tgpath
> else:
> result = tgpath
> ....
The question is: where to set this? I tried
[server:main]
in development.ini, and it puked on me about an unknown argument.
I then stuffed into
[app:main]
server.webpath = /collaborate
also in development.ini - but the access above reading "server.webpath"
doesn't work for me then. The value appears as this:
pylons.config.app_conf.get('server.webpath')
So... where is that supposed to be, and is this a bug?
Diez
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" 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/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---