I’m using Django with Google’s App Engine.
I want to send information to the server with percent encoded slashes. A request like http:/localhost/turtle/waxy%2Fsmooth that would match against a URL like r'^/turtle/(?P<type>([A-Za-z]|%2F)+)$'. The request gets to the server intact, but sometime before it is compared against the regex the %2F is converted into a forward slash.
What can I do to stop the %2Fs from being converted into forward slashes? Thanks!
os.environ['PATH_INFO']is decoded, so you lose that information. Probablyos.environ['REQUEST_URI']is available, and if it is available it is not decoded. Django only reads PATH_INFO. You could probably do something like:Then all cases of %2f are replaced with
****(or whatever you want to use).