Issue #1262 new

Cannot set from config file

created an issue

I set in my config file this, among other things:

[/] 'server'

Then, I run my app, but cherrypy.url creates absolute paths, including the server name.

Debugging it, I get this weird behavior:

>>> getattr(, 'relative_urls')
>>> getattr(cherrypy.request, 'app.relative_urls')
# Other stuff...
'/' :   {'' : 'server'}
>>> cherrypy.__version__

Seems like what the config parsing does is that it attaches an "app.relative_urls" property in cherrypy.request instead of setting the value of

Comments (4)

  1. Robert Brewer

    Since refers to an Application object that is shared between requests, it doesn't make sense (and can cause strange problems) to set config on it per request. If you'd like to be set for all URI's, you should probably do so in code, not config (before you call engine.start).

    If there's a case for making this setting configurable per URI, then we'd need to add a request.relative_urls attribute (in a future version).

  2. Log in to comment