In Flask, is there a way to get the request.path that includes any "decorations" that WSGI
or something else may add on?
Running in the test mode (just on port 5000), my request.path
and url_for('settings')
match up just fine, but once under WSGI
, as expected, my url_for('settings')
becomes /manage/settings/
, but the request.path
yeilds /settings/
.
I have the following in my httpd.conf
and am working on moving an application from development into a live site.
WSGIScriptAlias /manage /sw/servermanager/servermanager.wsgi
WSGIDaemonProcess servermgr user=user group=grp threads=4
<Directory /sw/servermanager>
WSGIProcessGroup servermgr
WSGIApplicationGroup %{GLOBAL}
WSGIScriptReloading On
Order deny,allow
Allow from all
</Directory>
I like the idea of having the templates be pretty generic and then display the navigation information on the fly using CSS. I've used the technique provided in this answer to structure my views to this point, but the issue arises when I add mod_wsgi
into the equation.
I took a look around the request object and didn't see as much as I'd like other than possibly using the url_rule
but then the parameters evaded me.
Just for good measure, a link for the WSGI Script that I'm using: https://github.com/FernFerret/servermanager/blob/master/servermanager.wsgi
I'd also be interested in the documentation for the request
object, I found my way around it by using the built in debugger and help(request)
.
EDIT: I should say, that the urls don't match up under Apache running mod_wsgi.